mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
Merge #31a50344: ci: cache Nix and Rust build inputs
nostr:nevent1qgsx2lyl2e4zvfadwcvkd9fkrcwczj7mf858hy85mwqclwgut8wpg2spz3mhxue69uhhyetvv9ujumn8d96zuer9wcq3yamnwvaz7tm8d96xummnw3ezucm0d5q3kamnwvaz7tmwva5hgtnyv9hxxmmwwashjer9wchxxmmdqqsrrfgrgj2lr8flyyquefg59jfgqze3h4h57e4f9keq32s8py6v3ts3ak2sv PR-Author: DanConwayDev's Agent nostr:npub1v47f74n2ycn66asev62nv8sas99akj0g0wg0fkup37u3ckwuzs4q7cwtp0 PR description: 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