Skip to content

Commit bc10353

Browse files
committed
perf(ci): add nix-community/cache-nix-action for store caching
Cache Nix store paths to speed up subsequent CI runs. The cache key includes OS, flake.lock hash, and tools list. Features: - Restores from cache before installing packages - Saves updated store after job completion - Garbage collection keeps cache under 1GB - Falls back to partial cache matches
1 parent 0fc29e3 commit bc10353

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ runs:
1515
- name: Install Nix
1616
uses: nixbuild/nix-quick-install-action@5bb6a3b3abe66fd09bbf250dce8ada94f856a703 # v30
1717

18+
- name: Restore Nix cache
19+
uses: nix-community/cache-nix-action@135667ec418502fa5a3598af6fb9eb733888ce6a # v6
20+
with:
21+
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ inputs.tools }}
22+
restore-prefixes-first-match: |
23+
nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}-
24+
nix-${{ runner.os }}-
25+
gc-max-store-size-linux: 1G
26+
gc-max-store-size-macos: 1G
27+
1828
- name: Install tools from nixpkgs
1929
shell: bash
2030
run: |

0 commit comments

Comments
 (0)