add build cache action
Some checks failed
Nix CI / Merge similar caches ([ubuntu-latest]) (pull_request) Has been cancelled
Nix CI / Check a `common` cache is restored correctly ([ubuntu-latest]) (pull_request) Has been cancelled
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Has been cancelled
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Has been cancelled
Check Nix formatting / Perform Nix format checks (pull_request) Has been cancelled
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 18s
Some checks failed
Nix CI / Merge similar caches ([ubuntu-latest]) (pull_request) Has been cancelled
Nix CI / Check a `common` cache is restored correctly ([ubuntu-latest]) (pull_request) Has been cancelled
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Has been cancelled
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Has been cancelled
Check Nix formatting / Perform Nix format checks (pull_request) Has been cancelled
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 18s
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
42
.github/workflows/flake-health-checks.yml
vendored
42
.github/workflows/flake-health-checks.yml
vendored
@ -15,6 +15,16 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
|
||||
- name: Restore Nix store
|
||||
id: restore
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# save a new cache every time `ci.yaml` changes
|
||||
primary-key: similar-cache-${{ matrix.os }}-individual-${{ hashFiles('flake.lock', '*.nix') }}
|
||||
# otherwise, restore a common cache if and only if it matches the current `ci.yaml`
|
||||
restore-prefixes-first-match: similar-cache-${{ matrix.os }}-common-
|
||||
|
||||
- name: Setup Attic cache
|
||||
uses: ryanccn/attic-action@v0
|
||||
with:
|
||||
@ -22,9 +32,13 @@ jobs:
|
||||
cache: ${{ secrets.ATTIC_CACHE }}
|
||||
token: ${{ secrets.ATTIC_TOKEN }}
|
||||
skip-push: "true"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: nix flake check --accept-flake-config
|
||||
|
||||
- run: nix ./utils/attic-push.bash
|
||||
|
||||
build-checks:
|
||||
name: "Build nix outputs"
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -33,6 +47,16 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
|
||||
- name: Restore Nix store
|
||||
id: restore
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# save a new cache every time `ci.yaml` changes
|
||||
primary-key: similar-cache-${{ matrix.os }}-individual-${{ hashFiles('flake.lock', '*.nix') }}
|
||||
# otherwise, restore a common cache if and only if it matches the current `ci.yaml`
|
||||
restore-prefixes-first-match: similar-cache-${{ matrix.os }}-common-
|
||||
|
||||
- name: Setup Attic cache
|
||||
uses: ryanccn/attic-action@v0
|
||||
with:
|
||||
@ -40,9 +64,27 @@ jobs:
|
||||
cache: ${{ secrets.ATTIC_CACHE }}
|
||||
token: ${{ secrets.ATTIC_TOKEN }}
|
||||
skip-push: "true"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build all outputs
|
||||
run: nix run git+https://nayeonie.com/ahuston-0/flake-update-diff -- --build .
|
||||
|
||||
- name: Push to Attic
|
||||
run: nix ./utils/attic-push.bash
|
||||
continue-on-error: true
|
||||
|
||||
- name: Save Nix store
|
||||
if: steps.restore.outputs.hit == 'false'
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# save a new cache every time `ci.yaml` changes
|
||||
primary-key: similar-cache-${{ matrix.os }}-individual-${{ hashFiles('flake.lock', '*.nix') }}
|
||||
# do purge caches
|
||||
purge: true
|
||||
# purge all versions of the individual cache
|
||||
purge-prefixes: similar-cache-${{ matrix.os }}-individual-
|
||||
# created more than 0 seconds ago relative to the start of the `Post Restore` phase
|
||||
purge-created: 0
|
||||
# except the version with the `primary-key`, if it exists
|
||||
purge-primary-key: never
|
||||
|
Reference in New Issue
Block a user