A GitHub action to check whether a Nix flake is properly cached. It builds
a derivation and fails if anything needs building rather than fetching
from a remote cache. You can permit some derivations to be built using the
permit_build_derivations
option.
Health warning: This action is scanning the output of nix build
.
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- uses: cachix/cachix-action@v12
with:
name: my-cache
- name: Check the cache
uses: holochain/nix-cache-check@v1
with:
derivation: .#my-derivation
There is also a working example (as long as the build is currently passing!) in the integration test for this action.