From a45058ba0291cd967c6a9b1b1af2c493caddc9cb Mon Sep 17 00:00:00 2001 From: Andrei Dziahel Date: Thu, 25 Jan 2024 15:31:28 +0100 Subject: [PATCH] ci: reuse more previous caches (Nix & Stack) --- .github/actions/setup-nix/action.yaml | 4 +++- .github/workflows/ci.yaml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-nix/action.yaml b/.github/actions/setup-nix/action.yaml index 9bdd094afd..c8de447d33 100644 --- a/.github/actions/setup-nix/action.yaml +++ b/.github/actions/setup-nix/action.yaml @@ -22,7 +22,9 @@ runs: with: key: cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}-${{ hashFiles('nix/**/*.nix', '.github/actions/setup-nix/*') }} restore-keys: | - cache-nix-${{ runner.os }}-common- + cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}- + cache-nix-${{ runner.os }}-id-common- + cache-nix-${{ runner.os }}- - uses: cachix/cachix-action@v14 with: name: postgrest diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 87cdc6c1a4..a8b8ab357c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,8 +98,6 @@ jobs: uses: ./.github/actions/setup-nix with: tools: tests withTools - # It seems like they are installing the same set of derivations, so we can assign them the same cache id. - # This would decrease the amount of caches dowloaded on merge cache step and will prevent disk space issues. cache-id: common - name: Run spec tests @@ -202,6 +200,8 @@ jobs: with: path: ${{ matrix.cache }} key: cache-stack-${{ runner.os }}-${{ hashFiles('stack.yaml.lock') }} + restore-keys: | + cache-stack-${{ runner.os }}- - name: Install dependencies if: ${{ matrix.deps }} run: ${{ matrix.deps }}