Skip to content

Commit 8fd39fa

Browse files
committed
ci: include lockfile hash in cache key for proper invalidation
Add flake.lock and uv.lock hash to the cache key so that: - Cache is saved when dependencies change (new hash = new key) - Old cache is still restored via restore-prefixes-first-match - Incremental updates build on previous cache This ensures cache hits do not prevent saving updated derivations while still benefiting from partial cache restoration.
1 parent 871c076 commit 8fd39fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/actions/setup-nix/action.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ runs:
1616
- name: Cache Nix store
1717
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
1818
with:
19-
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}
19+
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('flake.lock', 'uv.lock') }}
2020
restore-prefixes-first-match: |
21+
nix-${{ runner.os }}-${{ inputs.python-version }}-
2122
nix-${{ runner.os }}-
2223
gc-max-store-size: 4G

0 commit comments

Comments
 (0)