Use github run_id as "random" key

This commit is contained in:
Tom Parker-Shemilt 2024-03-17 13:58:02 +00:00
parent 64ccfe3e52
commit aeac71fdfb

View file

@ -20,15 +20,12 @@ jobs:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Get random cache id
run: echo "CACHE_ID=$((RANDOM))" >> $GITHUB_ENV
shell: bash
- name: Load rust cache
uses: actions/cache@v4
with:
save-always: true
path: results/*.yaml
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ env.CACHE_ID }}
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ github.run_id }}
restore-keys: |
results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-
results-${{ hashFiles('Cargo.lock') }}-