Skip to content

Commit

Permalink
github/build-checks: use cache-nix-action instead of magix-nix-cache-…
Browse files Browse the repository at this point in the history
…action

the magic-nix-cache action was deprecated due to a change in the GitHub
cache API.

See https://determinate.systems/posts/magic-nix-cache-free-tier-eol/
  • Loading branch information
minijackson committed Feb 17, 2025
1 parent de227d3 commit 43b79cb
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
name: ${{ matrix.name }} (${{ matrix.system }})
needs: nix-matrix
runs-on: ${{ matrix.os }}
permissions:
actions: write
env:
CHECK_ATTR: ${{ matrix.attr }}
strategy:
Expand All @@ -36,8 +38,22 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8
- run: |
# Enable KVM on Linux so NixOS tests can run.
# Do this early in the process so nix installation detects the KVM feature.
enable_kvm() {
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-install-nix-action-kvm.rules
sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm
}
if [[ "$OSTYPE" =~ linux* ]]; then
enable_kvm && echo 'Enabled KVM' || echo 'KVM is not available'
fi
- uses: nixbuild/nix-quick-install-action@25aff27c252e0c8cdda3264805f7b6bcd92c8718 # v29
- uses: nix-community/cache-nix-action@8351fb9f51c580c96c509987ebb99e38aed956ce # v5.2.1
with:
diagnostic-endpoint: ""
primary-key: build-${{ runner.os }}-${{ matrix.name }}-${{ hashFiles('.github/workflows/build-checks.yml', 'flake.lock') }}
purge: true
purge-last-accessed: 2629800 # 1 month
purge-prefixes: build-${{ runner.os }}-${{ matrix.name }}-
purge-primary-key: never
- run: nix build -L ".#${CHECK_ATTR}"

0 comments on commit 43b79cb

Please sign in to comment.