Skip to content

Commit

Permalink
ci: Run minimal/maximal version tests in the 'tests' job (#455)
Browse files Browse the repository at this point in the history
By running fewer jobs we should need fewer workers and burn up less CPU
time, and hopefully spend less time waiting for jobs to launch. Also, at
least some build products should be reusable between these tests.
  • Loading branch information
sourcefrog authored Nov 22, 2024
2 parents 6daabb8 + 28e1061 commit 433a6af
Showing 1 changed file with 11 additions and 47 deletions.
58 changes: 11 additions & 47 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,47 +117,20 @@ jobs:
- name: Check clippy
# TODO: Deny warnings
run: cargo clippy --all-targets --all-features
- run: cargo update
- name: Test after cargo update
run: cargo test --workspace
- name: Downgrade to minimal versions
if: matrix.version == 'nightly'
run: cargo +nightly -Zdirect-minimal-versions update
- name: Test on minimal versions
if: matrix.version == 'nightly'
run: cargo test
- name: Install locked
run: cargo install --locked --path .
run: cargo install --path . --locked
- name: Install unlocked
run: cargo install --path .

minimal-versions:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly -Zdirect-minimal-versions update
- run: cargo build --all-targets
- uses: taiki-e/install-action@v2
name: Install nextest using install-action
with:
tool: nextest
- run: cargo test

# Run `cargo update` and check the tests still pass
maximal-versions:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo update
- uses: taiki-e/install-action@v2
name: Install nextest using install-action
with:
tool: nextest
- run: cargo test

tests-from-tarball:
needs: [quick-test]
strategy:
Expand Down Expand Up @@ -270,16 +243,7 @@ jobs:
path: mutants.out

overall-result:
needs:
[
quick-test,
test,
minimal-versions,
maximal-versions,
tests-from-tarball,
pr-mutants,
cargo-mutants,
]
needs: [quick-test, test, tests-from-tarball, pr-mutants, cargo-mutants]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down

0 comments on commit 433a6af

Please sign in to comment.