From 52b2221b426d3f4c60c634a2ee1821e858412631 Mon Sep 17 00:00:00 2001 From: zimward Date: Sat, 16 May 2026 11:06:28 +0200 Subject: [PATCH] ci: fix incorrect cache hits right now during the post phase we always hit the cache as the primary key is just the os instead of the revision. this causes newer cache artifacts to never be uploaded --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81910f8..5b98729 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,11 @@ jobs: - name: Setup Nix cache uses: nix-community/cache-nix-action@v7 with: - primary-key: nix-${{ runner.os }} + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} + restore-prefixes-first-match: nix-${{ runner.os }}- + # don't keep caches from previous CI runs around. newest main should always be enough + purge: true + purge-prefixes: nix-${{ runner.os }}- - name: Run checks run: nix flake check --log-format bar-with-logs