ci/lint: Use the Rust nightly date as a cache prefix

Using the nightly date prevents reusing caches from older toolchains,
reducing unnecessary downloads and avoiding wasted cache space.
reviewable/pr1409/r2
Michal R 2 weeks ago
parent da383deb2e
commit 1c25ce2357

@ -27,7 +27,15 @@ jobs:
# Installed *after* nightly so it is the default. # Installed *after* nightly so it is the default.
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
- id: nightly-prefix
run: |
set -euo pipefail
prefix="$(rustc +nightly --version --verbose | awk '/commit-date/ {print "nightly-" $2}')"
echo "value=$prefix" >> "$GITHUB_OUTPUT"
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ steps.nightly-prefix.outputs.value }}
- uses: taiki-e/install-action@v2 - uses: taiki-e/install-action@v2
with: with:

Loading…
Cancel
Save