From d6d0d34bba3eb906a53482f7d785b19bdce359ec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Nov 2026 19:42:57 -0600 Subject: [PATCH] [ci] Reuse unchanged Cargo cache snapshots Key Cargo snapshots by compiler, build configuration, Rust sources, and public headers instead of run ID. An exact cache hit can now skip the upload rather than storing another copy on each successful run. Retain the existing restore prefix for incremental rebuilds. Validation: actionlint, git diff --check, and meson test -C build (302 passed, one skipped). Remote snapshot reuse remains for CI. Assisted-by: OpenAI Codex --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9c02b160b..8257c2167 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -59,7 +59,7 @@ jobs: ~/.cargo/git build/src/rust/debugoptimized build/src/rust/.rustc_info.json - key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-compiler.outputs.version }}-${{ hashFiles('src/rust/Cargo.toml', 'src/rust/meson.build') }}-${{ github.run_id }}-${{ github.run_attempt }} + key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-compiler.outputs.version }}-${{ hashFiles('src/rust/Cargo.toml', 'src/rust/meson.build') }}-${{ hashFiles('src/*.h', 'src/rust/*.rs', '.github/workflows/rust.yml') }} restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-compiler.outputs.version }}-${{ hashFiles('src/rust/Cargo.toml', 'src/rust/meson.build') }}- - name: Setup Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0