Skip to content

Commit 6145c88

Browse files
committed
Cache improvements
1 parent 8e45a72 commit 6145c88

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/composite/rust/action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ runs:
3232
- name: "Configure"
3333
id: configure
3434
run: |
35+
echo "Rust cache shared-key: '${{ runner.os }}-${{ inputs.rust }}${{ inputs.cache-key }}'"
3536
echo "components=$( for c in ${cs//,/ }; do echo -n ' --component' $c; done )" >> $GITHUB_OUTPUT
3637
env:
3738
cs: ${{ inputs.components }}
@@ -46,7 +47,18 @@ runs:
4647
- name: "Reuse cached dependencies"
4748
uses: Swatinem/rust-cache@v2
4849
with:
49-
shared-key: ${{ inputs.cache-key }}
50+
# A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs.
51+
# default: empty
52+
shared-key: "${{ runner.os }}-${{ inputs.rust }}${{ inputs.cache-key }}"
53+
54+
# An additional cache key that is added alongside the automatic `job`-based
55+
# cache key and can be used to further differentiate jobs.
56+
# default: empty
57+
key: ${{ inputs.cache-key }}
58+
59+
# Determines if the cache should be saved even when the workflow has failed.
60+
# default: "false"
61+
cache-on-failure: true
5062

5163
- name: "Install LLVM"
5264
uses: ./.github/composite/llvm

.github/workflows/full-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
uses: ./.github/composite/rust
145145
with:
146146
rust: stable
147-
cache-key: ${{ matrix.rust-special }} # 'minimal-deps' or empty/not defined
147+
cache-key: ${{ matrix.rust-special }} # '-minimal-deps' or empty/not defined
148148
with-llvm: ${{ matrix.with-llvm }}
149149

150150
- name: "Install Rust nightly (minimal deps)"

0 commit comments

Comments
 (0)