From 422dc687b3d6277387730823ae9b622399fc7be0 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:46:40 -0800 Subject: [PATCH 1/3] 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 be9787d1..9cfb8b8a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,6 +66,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: strategy: From dce7fcecc46f130cb2f00dce5f3e846e0540817a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Nov 2024 07:47:59 -0800 Subject: [PATCH 2/3] fix: Install clippy --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9cfb8b8a..c658e818 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,7 +50,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 @@ -210,7 +210,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() From 1bf77085b536c73d951cadef734e6a4f55204723 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 22 Nov 2024 08:02:08 -0800 Subject: [PATCH 3/3] Only enforce clippy on stable --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 590bd80a..d5ad7f56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,7 +59,6 @@ jobs: 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 @@ -112,6 +111,9 @@ jobs: - name: Check rustfmt run: cargo fmt --all --check - name: Check clippy + if: matrix.version == 'stable' + # Clippy checks can vary between versions in a way that makes it a bit + # fiddly to satisfy them all, so only insist that they pass on stable. run: cargo clippy --all-targets --all-features -- -D warnings minimal-versions: