From a01b3307481bb9340a0dd2e8dff7d88c63c40e6f Mon Sep 17 00:00:00 2001 From: Zohar Zilberman Date: Thu, 28 May 2026 20:39:35 +0300 Subject: [PATCH] Treat warnings as errors and parallelize clippy/test jobs - Set RUSTFLAGS=-D warnings on the test workflow so any rustc/clippy warning fails CI. The explicit `-- -D warnings` clippy suffix is now redundant; one matrix step runs `cargo hack ${task}` selected by matrix.task. - Expand the matrix to {profile} x {task} so clippy and test runs run in parallel across 4 jobs instead of serializing within one. - Drop unused `mod fake_db;` from the v1beta{1,2}_values_bad tests; the dead_code warnings on TestDb/TestDbError would otherwise fail under -D warnings. - Bump actions/checkout to v6 in both workflows (resolves the Node 20 deprecation notice). --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 17 +++++++++-------- tests/v1beta1_values_bad.rs | 1 - tests/v1beta2_values_bad.rs | 1 - 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c645412..bba69fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: ๐Ÿ›  Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: ๐Ÿš€ Publish Crate env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 575dc8a..4a2907f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ permissions: jobs: test: - name: ๐Ÿงช Test (${{ matrix.profile }}) + name: ๐Ÿงช ${{ matrix.task }} (${{ matrix.profile }}) runs-on: ubuntu-latest strategy: fail-fast: false @@ -17,19 +17,20 @@ jobs: profile: - debug - release + task: + - clippy + - test + env: + RUSTFLAGS: -D warnings steps: - name: ๐Ÿ›  Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: ๐Ÿ”ง Install cargo-hack uses: taiki-e/install-action@v2 with: tool: cargo-hack - - name: ๐Ÿ“ฆ Cargo clippy (feature powerset) + - name: ๐Ÿ“ฆ Cargo ${{ matrix.task }} (feature powerset) run: | - cargo hack clippy --feature-powerset ${{ matrix.profile == 'release' && '--release' || '' }} -- -D warnings - - - name: ๐Ÿงช Cargo test (feature powerset) - run: | - cargo hack test --feature-powerset ${{ matrix.profile == 'release' && '--release' || '' }} + cargo hack ${{ matrix.task }} --feature-powerset ${{ matrix.profile == 'release' && '--release' || '' }} diff --git a/tests/v1beta1_values_bad.rs b/tests/v1beta1_values_bad.rs index 93fc1da..7c1fd74 100644 --- a/tests/v1beta1_values_bad.rs +++ b/tests/v1beta1_values_bad.rs @@ -1,4 +1,3 @@ -mod fake_db; mod utils; use anyhow::Result; diff --git a/tests/v1beta2_values_bad.rs b/tests/v1beta2_values_bad.rs index ccef76a..c566624 100644 --- a/tests/v1beta2_values_bad.rs +++ b/tests/v1beta2_values_bad.rs @@ -1,4 +1,3 @@ -mod fake_db; mod utils; use anyhow::Result;