diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a854763..2844a0c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,8 @@ jobs: components: rustfmt, clippy - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + with: + key: ${{ hashFiles('**/Cargo.lock') }} - name: Cargo fmt run: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ea037819..7c9336a5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -30,6 +30,8 @@ jobs: uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + with: + key: ${{ hashFiles('**/Cargo.lock') }} - name: Install a specific version of uv uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 1e253b1c..fd04e2b9 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -52,6 +52,12 @@ jobs: uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + with: + # rust-cache normalizes version numbers before hashing Cargo.lock, + # so minor/patch dep bumps don't invalidate the cache. Append the + # raw lockfile hash (and matrix Python version) to force a fresh + # cache entry whenever Cargo.lock actually changes. + key: ${{ matrix.python-version }}-${{ hashFiles('**/Cargo.lock') }} - name: Install uv uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7