From f7e7e4c199521eba5b5fc45142807e7404556f22 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:16:26 -0800 Subject: [PATCH 1/7] ci: Add an overall conclusion job --- .github/workflows/tests.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index be9787d1..2ee4105a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -206,7 +206,8 @@ jobs: - name: Mutants in-diff # Normally this would have --in-place, but for the sake of exercising more cases, it does not. run: > - cargo mutants --no-shuffle -vV --in-diff git.diff --test-tool=${{matrix.test_tool}} --timeout=500 --build-timeout=500 + cargo mutants --no-shuffle -vV --in-diff git.diff + --test-tool=${{matrix.test_tool}} --timeout=500 --build-timeout=500 - name: Archive mutants.out uses: actions/upload-artifact@v4 if: always() @@ -261,3 +262,26 @@ jobs: - name: Check spelling uses: crate-ci/typos@master + + overall-result: + needs: + [ + test, + minimal-versions, + maximal-versions, + tests-from-tarball, + install, + release-binary, + pr-mutants, + cargo-mutants, + typos, + ] + runs-on: ubuntu-latest + if: always() + steps: + - name: Successful workflow + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Failing workflow + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 From 7806cf62a7074e650bd18c06b0942d7b36cec3e4 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:21:31 -0800 Subject: [PATCH 2/7] chore: Update Pages actions --- .github/workflows/release-book.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-book.yml b/.github/workflows/release-book.yml index e4785e2f..fa1c4019 100644 --- a/.github/workflows/release-book.yml +++ b/.github/workflows/release-book.yml @@ -30,14 +30,14 @@ jobs: with: tool: mdbook, mdbook-linkcheck - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 - name: Build book run: | mdbook build book - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 with: path: "book/book/html" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 From e40b205f609d3e31b7b5ed7c2c00d5c6c420ff69 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:29:50 -0800 Subject: [PATCH 3/7] ci: Start mutants as soon as Linux build succeeds --- .github/workflows/tests.yml | 67 +++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ee4105a..24567d39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,45 @@ env: CARGO_MUTANTS_MINIMUM_TEST_TIMEOUT: 60 jobs: + # Before anything else, run a quick test on just stable: this is significantly + # faster than Windows or macOS and should catch most issues, and lets us get + # started on the longer-running mutants and other tests. + # + # Also, build a Linux binary that we can use for the later mutants runs. + quick-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: beta + - uses: Swatinem/rust-cache@v2 + - name: Show Cargo and rustc version + run: | + cargo --version + rustc --version + # TODO: Maybe also check clippy and rustfmt here. + - name: Build + run: cargo build --all-targets + - uses: taiki-e/install-action@v2 + name: Install nextest using install-action + with: + tool: nextest + - name: Test + run: cargo test --workspace + - name: Build release binary + run: cargo build --release + - name: Upload binary artifact + uses: actions/upload-artifact@v4 + with: + name: cargo-mutants-linux + path: | + target/release/cargo-mutants + test: + needs: [quick-test] strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] @@ -68,6 +106,7 @@ jobs: run: cargo test --workspace minimal-versions: + needs: [quick-test] strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] @@ -86,6 +125,7 @@ jobs: # Run `cargo update` and check the tests still pass maximal-versions: + needs: [quick-test] strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] @@ -102,6 +142,7 @@ jobs: - run: cargo test tests-from-tarball: + needs: [quick-test] strategy: matrix: os: [ubuntu-latest] @@ -136,6 +177,7 @@ jobs: # their MSRV, and on every platform because there are platform-specific # dependencies. install: + needs: [quick-test] strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] @@ -154,29 +196,10 @@ jobs: - run: cargo install --locked --path . - run: cargo install --path . - release-binary: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: beta - - uses: Swatinem/rust-cache@v2 - - name: Build - run: cargo build --release - - name: Upload binary artifact - uses: actions/upload-artifact@v4 - with: - name: cargo-mutants-linux - path: | - target/release/cargo-mutants - pr-mutants: runs-on: ubuntu-latest - needs: [release-binary] if: github.event_name == 'pull_request' + needs: [quick-test] strategy: matrix: test_tool: [cargo, nextest] @@ -217,7 +240,7 @@ jobs: cargo-mutants: runs-on: ubuntu-latest - needs: [test, release-binary] + needs: [quick-test] strategy: fail-fast: false # We want to get all the mutant failures matrix: @@ -266,12 +289,12 @@ jobs: overall-result: needs: [ + quick-test, test, minimal-versions, maximal-versions, tests-from-tarball, install, - release-binary, pr-mutants, cargo-mutants, typos, From 4d1d7de0a6f28cc8319c8319949cb289572b0651 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:36:12 -0800 Subject: [PATCH 4/7] ci: Run rustfmt and clippy --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 24567d39..7731ffaf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,6 +67,10 @@ jobs: tool: nextest - name: Test run: cargo test --workspace + - name: Check rustfmt + run: cargo fmt --all --check + - name: Check clippy + run: cargo clippy --all-targets --all-features -- -D warnings - name: Build release binary run: cargo build --release - name: Upload binary artifact From 8b33c19941e72bffa98c3d9f95f70eeb0f303f42 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:49:18 -0800 Subject: [PATCH 5/7] fix: install rustfmt and clippy --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7731ffaf..309162eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,6 +53,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: beta + components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - name: Show Cargo and rustc version run: | @@ -92,7 +93,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.version }} - components: rustfmt + components: rustfmt, clippy - name: Show Cargo and rustc version run: | cargo --version From ed0060a10f503ce3f6a3e6a91293ca5078afe2c3 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:46:40 -0800 Subject: [PATCH 6/7] ci: Check rustfmt/clippy on all platforms --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 309162eb..590bd80a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,6 +109,10 @@ jobs: run: cargo build --all-targets - name: Test run: cargo test --workspace + - name: Check rustfmt + run: cargo fmt --all --check + - name: Check clippy + run: cargo clippy --all-targets --all-features -- -D warnings minimal-versions: needs: [quick-test] From 762ff51c4452acee48bf7da608d3c568bac090ac Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:58:08 -0800 Subject: [PATCH 7/7] fix: Don't block on clippy warnings for now --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 590bd80a..e33590a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,7 +71,8 @@ jobs: - name: Check rustfmt run: cargo fmt --all --check - name: Check clippy - run: cargo clippy --all-targets --all-features -- -D warnings + # TODO: -- -D warnings + run: cargo clippy --all-targets --all-features - name: Build release binary run: cargo build --release - name: Upload binary artifact @@ -112,7 +113,8 @@ jobs: - name: Check rustfmt run: cargo fmt --all --check - name: Check clippy - run: cargo clippy --all-targets --all-features -- -D warnings + # TODO: Deny warnings + run: cargo clippy --all-targets --all-features minimal-versions: needs: [quick-test]