From 4f6a1068b7ab50da7b0e0db77a087447d2f8b0a3 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 11 Dec 2023 20:43:02 +0100 Subject: [PATCH] wip: test hashing flake.lock file --- .forgejo/workflows/check.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 13efab4..b041caf 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -17,18 +17,23 @@ jobs: substituters = https://cache.nixos.org/ https://nix-community.cachix.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= keep-outputs = true + - name: Calculate flake.lock hash + id: flake-lock-hash + run: | + echo "hash=$(md5sum flake.lock)" >> $GITHUB_OUTPUT - name: Restore and cache Nix store uses: https://github.com/nix-community/cache-nix-action@v4 + id: nix-store-cache # use this to check for `cache-hit` (`steps.nix-store-cache.outputs.cache-hit != 'true'`) with: - key: cache-x86_64-linux-nix-store + key: cache-x86_64-linux-nix-store-${{ steps.flake-lock-hash.outputs.hash }} restore-keys: | - cache-x86_64-linux- + cache-x86_64-linux-nix-store- gc-linux: true gc-max-store-size-linux: 10000000000 purge-caches: true - purge-key: cache-x86_64-linux- + purge-key: cache-x86_64-linux-nix-store- purge-created: true purge-created-max-age: 42 - name: Check out repository code