ci: revert cache-nix-action to version 4.0.3

This commit is contained in:
teutat3s 2024-04-23 12:03:16 +02:00
parent d5fe65b60d
commit c4d0d34807
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -24,20 +24,20 @@ jobs:
echo "hash=$(md5sum flake.lock | awk '{print $1}')" >> $GITHUB_OUTPUT echo "hash=$(md5sum flake.lock | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Restore and cache Nix store - name: Restore and cache Nix store
uses: https://github.com/nix-community/cache-nix-action@v5 uses: https://github.com/nix-community/cache-nix-action@v4.0.3
id: nix-store-cache id: nix-store-cache
with: with:
primary-key: cache-${{ runner.os }}-nix-store-${{ steps.flake-lock-hash.outputs.hash }} key: cache-${{ runner.os }}-nix-store-${{ steps.flake-lock-hash.outputs.hash }}
restore-prefixes-first-match: | restore-keys: |
cache-${{ runner.os }}-nix-store- cache-${{ runner.os }}-nix-store-
gc-linux: true gc-linux: true
gc-max-store-size-linux: 10000000000 gc-max-store-size-linux: 10000000000
purge: true purge-caches: true
purge-prefixes: cache-${{ runner.os }}-nix-store- purge-key: cache-${{ runner.os }}-nix-store-
purge-created: 42 purge-created: true
purge-primary-key: never purge-created-max-age: 42
- name: Prepare cachix - name: Prepare cachix
uses: https://github.com/cachix/cachix-action@v14 uses: https://github.com/cachix/cachix-action@v14
@ -49,3 +49,12 @@ jobs:
- name: Run flake checks - name: Run flake checks
run: | run: |
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check
# Prevent cache garbage collection
for target in $(nix flake show --json --all-systems | jq '
.["nixosConfigurations"] |
to_entries[] |
.key
' | tr -d '"'
); do
nix profile install --profile "/nix/var/nix/profiles/$target" ".#nixosConfigurations.${target}.config.system.build.toplevel"
done