From a20e15c63ae414c03498cc8726dbe9e7d66fb0de Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 20 Jan 2025 03:07:03 -0500 Subject: [PATCH] use more specific primary-key and prefix-match --- .github/workflows/build-and-cache.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-cache.yml b/.github/workflows/build-and-cache.yml index 217fd43..9e75256 100644 --- a/.github/workflows/build-and-cache.yml +++ b/.github/workflows/build-and-cache.yml @@ -53,9 +53,9 @@ jobs: uses: nix-community/cache-nix-action@v5.1.0 with: # restore and save a cache using this key - primary-key: nix-${{ runner.os }}-${{ matrix.machine }}-${{ hashFiles('flake.lock') }} + primary-key: nix-${{ runner.os }}-${{ matrix.machine }}-${{ hashFiles('**/*.nix', 'flake.lock') }} # if there's no cache hit, restore a cache by this prefix - restore-prefixes-first-match: nix-${{ runner.os }}- + restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.machine }}- # do purge caches purge: true # purge all versions of the cache @@ -119,9 +119,9 @@ jobs: uses: nix-community/cache-nix-action@v5.1.0 with: # restore and save a cache using this key - primary-key: nix-${{ runner.os }}-${{ matrix.home }}-${{ hashFiles('flake.lock') }} + primary-key: nix-${{ runner.os }}-${{ matrix.home }}-${{ hashFiles('**/*.nix', 'flake.lock') }} # if there's no cache hit, restore a cache by this prefix - restore-prefixes-first-match: nix-${{ runner.os }}- + restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.home }}- # do purge caches purge: true # purge all versions of the cache