Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit CI runner version #2996

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@protoc
Expand All @@ -22,41 +22,44 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Check
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: rustfmt
run: cargo fmt --all --check

check-docs:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: cargo doc
env:
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests"
run: cargo doc --all-features --no-deps

cargo-hack:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@protoc
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Install cargo-hack
run: |
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: cargo hack check
run: cargo hack check --each-feature --no-dev-deps --all

cargo-public-api-crates:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
crate: [axum, axum-core, axum-extra, axum-macros]
Expand All @@ -69,6 +72,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Install cargo-public-api-crates
run: |
cargo install --git https://github.com/davidpdrsn/cargo-public-api-crates
Expand All @@ -80,7 +84,7 @@ jobs:

test-versions:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
rust: [stable, beta]
Expand All @@ -93,13 +97,14 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Run tests
run: cargo test --workspace --all-features --all-targets

# some examples doesn't support our MSRV so we only test axum itself on our MSRV
# some examples don't support our MSRV so we only test axum itself on our MSRV
test-nightly:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Get rust-toolchain version
Expand All @@ -111,15 +116,16 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Run nightly tests
working-directory: axum-macros
run: cargo test

# some examples doesn't support our MSRV (such as async-graphql)
# some examples don't support our MSRV (such as async-graphql)
# so we only test axum itself on our MSRV
test-msrv:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand All @@ -130,6 +136,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Select minimal version
run: cargo +nightly update -Z minimal-versions
- name: Fix up Cargo.lock
Expand Down Expand Up @@ -157,19 +164,20 @@ jobs:

test-docs:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Run doc tests
run: cargo test --all-features --doc

deny-check:
name: cargo-deny check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
continue-on-error: ${{ matrix.checks == 'advisories' }}
strategy:
matrix:
Expand All @@ -185,7 +193,7 @@ jobs:

armv5te-unknown-linux-musleabi:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -194,6 +202,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Check
env:
# Clang has native cross-compilation support
Expand All @@ -211,7 +220,7 @@ jobs:

wasm32-unknown-unknown:
needs: check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -220,6 +229,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Check
run: >
cargo
Expand All @@ -228,13 +238,14 @@ jobs:
--target wasm32-unknown-unknown

dependencies-are-sorted:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@beta
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
prefix-key: "v0-rust-ubuntu-24.04"
- name: Install cargo-sort
run: |
cargo install cargo-sort
Expand All @@ -247,7 +258,7 @@ jobs:

typos:
name: Spell Check with Typos
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.event_name == 'push' || !github.event.pull_request.draft

steps:
Expand Down