Skip to content

Commit 38e7b0f

Browse files
Modify rust cache shared-key (#6046)
From reading the action's source code: 1. Job ID is only included if we don't provide da `shared-key`, which I think we do want to include. 2. OS and architecture always gets added by the actions 3. We should include `RUSTFLAGS` in the cache key, as actions that don't agree on it will end up re-compiling the world. --------- Signed-off-by: Adam Gutglick <adam@spiraldb.com> Co-authored-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent cb31e1c commit 38e7b0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ runs:
5353
uses: Swatinem/rust-cache@v2
5454
with:
5555
save-if: ${{ github.ref_name == 'develop' }}
56-
shared-key: "rust-cache-${{ runner.os }}-${{ runner.arch }}-${{ runner.environment }}-${{ steps.rust-toolchain.outputs.cachekey }}-${{ inputs.targets }}${{ inputs.cache-suffix && format('-{0}', inputs.cache-suffix) || '' }}"
56+
# os and arch by default
57+
shared-key: "rust-cache-${{ github.job }}-${{ runner.environment }}-${{ steps.rust-toolchain.outputs.cachekey }}-${{ inputs.targets }}${{ inputs.cache-suffix && format('-{0}', inputs.cache-suffix) || '' }}"
58+
env-vars: "RUSTFLAGS"
5759

5860
- name: Rust Compile Cache
5961
uses: mozilla-actions/sccache-action@v0.0.9

0 commit comments

Comments
 (0)