From 1c25ce235794177ad33bc4de65eec8467c9663c6 Mon Sep 17 00:00:00 2001 From: Michal R Date: Fri, 5 Dec 2025 21:05:43 +0100 Subject: [PATCH] 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. --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8c33e73..d460f402 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,15 @@ jobs: # Installed *after* nightly so it is the default. - 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 + with: + prefix-key: ${{ steps.nightly-prefix.outputs.value }} - uses: taiki-e/install-action@v2 with: