From 04f163363ee4c54d091f1ee29f2e7e39d890be59 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 20 Jul 2026 14:48:41 +0200 Subject: [PATCH 1/2] ci: `cargo autoinherit` check After centralizing all deps in the top-level `Cargo.toml`, this change adds a CI check to ensure that future deps are also consistently added there. --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9aabb8f55..6c5ef9725 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,3 +23,30 @@ jobs: - name: Run cargo clippy run: cargo clippy --all-features --workspace --tests --examples --locked -- -D clippy::all + + autoinherit: + name: Check workspace dependency inheritance + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout sources + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + persist-credentials: false + + - uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 + with: + cache-bin: true + + - name: Install cargo-autoinherit + run: cargo install cargo-autoinherit --version 0.1.6 --locked + + - name: Check workspace dependency inheritance + run: | + cargo autoinherit + if ! git diff --quiet; then + echo "::error title=Workspace dependencies are not centralized::cargo autoinherit found dependency declarations that are not inherited from " \ + "workspace.dependencies. Run 'cargo autoinherit' locally and commit the resulting Cargo.toml changes." + git diff --exit-code + fi From a2e1e58353d88b714fb58cdf8872632904963ae3 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 20 Jul 2026 16:32:15 +0200 Subject: [PATCH 2/2] fixup! ci: `cargo autoinherit` check --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6c5ef9725..1941cb875 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,8 +45,8 @@ jobs: - name: Check workspace dependency inheritance run: | cargo autoinherit - if ! git diff --quiet; then + if ! git diff --exit-code; then echo "::error title=Workspace dependencies are not centralized::cargo autoinherit found dependency declarations that are not inherited from " \ "workspace.dependencies. Run 'cargo autoinherit' locally and commit the resulting Cargo.toml changes." - git diff --exit-code + exit 1 fi