mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
ci: cache Nix and Rust build inputs
Reuse Nix store paths, Cargo sources, and Rust target artifacts across ngit-ci runs. Keys track the flake, toolchain, and Cargo dependency inputs while prefix restores preserve useful overlap after updates. Cache restore and save remain non-fatal optimizations, and the existing formatting, lint, and test commands are unchanged. Validated by listing the workflow with act and checking the resulting diff.
This commit is contained in:
@@ -22,6 +22,23 @@ jobs:
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Restore Nix store cache
|
||||
continue-on-error: true
|
||||
uses: nix-community/cache-nix-action@v7
|
||||
with:
|
||||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||
- name: Restore Rust build cache
|
||||
continue-on-error: true
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/git
|
||||
~/.cargo/registry
|
||||
target
|
||||
key: rust-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', 'Cargo.lock', 'flake.lock') }}
|
||||
restore-keys: |
|
||||
rust-${{ runner.os }}-
|
||||
# The suite must be hermetic with respect to ambient git configuration,
|
||||
# so CI always runs it under a deliberately hostile global config: a
|
||||
# failing pre-commit hook delivered via both core.hooksPath and
|
||||
|
||||
Reference in New Issue
Block a user