From 101a31555fbe039113c55ec641ec9f1d4121abf2 Mon Sep 17 00:00:00 2001 From: pasta Date: Thu, 1 Aug 2024 14:27:01 -0500 Subject: [PATCH] refactor: simplify caching setup, add a restore key to actually cache besides 1 run --- .github/workflows/guix-build.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/guix-build.yml b/.github/workflows/guix-build.yml index be2b12262b..aef8597b05 100644 --- a/.github/workflows/guix-build.yml +++ b/.github/workflows/guix-build.yml @@ -46,16 +46,21 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - - name: Restore Guix cache and depends + - name: Cache Guix and depends id: guix-cache-restore - uses: actions/cache/restore@v3 + uses: actions/cache@v3 with: path: | ${{ github.workspace }}/.cache ${{ github.workspace }}/dash/depends/built ${{ github.workspace }}/dash/depends/sources ${{ github.workspace }}/dash/depends/work - key: ${{ runner.os }}-guix + key: ${{ runner.os }}-guix-${{ github.event.pull_request.head.sha }} + restore-keys: | + ${{ runner.os }}-guix-${{ github.event.pull_request.head.sha }} + ${{ runner.os }}-guix- + + - name: Create .cache folder if missing if: steps.guix-cache-restore.outputs.cache-hit != 'true' @@ -80,17 +85,6 @@ jobs: exit 1 fi - - name: Save Guix cache and depends - id: guix-cache-save - uses: actions/cache/save@v3 - with: - path: | - ${{ github.workspace }}/.cache - ${{ github.workspace }}/dash/depends/built - ${{ github.workspace }}/dash/depends/sources - ${{ github.workspace }}/dash/depends/work - key: ${{ steps.guix-cache-restore.outputs.cache-primary-key }} - - name: Compute SHA256 checksums run: | ./dash/contrib/containers/guix/scripts/guix-check ${{ github.workspace }}/dash