From 458f6d30ba79c1e997bbceee33985b8475180eed Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 10 Jan 2025 18:41:15 +0000 Subject: [PATCH 1/3] Run fast clippy/fmt/typos before relatively slow tests --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cf2ae96..e57bf8e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,18 +48,18 @@ jobs: rustc --version - 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: Check rustfmt run: cargo fmt --all --check - name: Check clippy run: cargo clippy --all-targets --all-features -- -D warnings - name: Check typos uses: crate-ci/typos@master + - 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 From ae6ccdb0d8929adc0299a8c22255b83123db7fed Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 10 Jan 2025 18:46:39 +0000 Subject: [PATCH 2/3] Also check rustfmt/clippy earlier on other platforms --- .github/workflows/tests.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e57bf8e4..6b37ac79 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -87,8 +87,13 @@ jobs: cargo --version rustc --version - uses: Swatinem/rust-cache@v2 - - name: rustfmt - run: cargo fmt --all -- --check + - 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 - uses: taiki-e/install-action@v2 name: Install nextest using install-action with: @@ -97,13 +102,6 @@ jobs: run: cargo build --all-targets - name: Test run: cargo test --workspace - - 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 - run: cargo update - name: Test after cargo update run: cargo test --workspace From 63c25159301be47d4a571dce727486555e19d47e Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 10 Jan 2025 18:46:58 +0000 Subject: [PATCH 3/3] Build before installing nextest More likely to find interesting failures early --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b37ac79..9e6cba44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,12 +94,12 @@ jobs: # 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 + - name: Build + run: cargo build --all-targets - uses: taiki-e/install-action@v2 name: Install nextest using install-action with: tool: nextest - - name: Build - run: cargo build --all-targets - name: Test run: cargo test --workspace - run: cargo update