Skip to content

Commit 101a315

Browse files
refactor: simplify caching setup, add a restore key to actually cache besides 1 run
1 parent 1b139e4 commit 101a315

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/guix-build.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,21 @@ jobs:
4646
cache-from: type=gha
4747
cache-to: type=gha,mode=max
4848

49-
- name: Restore Guix cache and depends
49+
- name: Cache Guix and depends
5050
id: guix-cache-restore
51-
uses: actions/cache/restore@v3
51+
uses: actions/cache@v3
5252
with:
5353
path: |
5454
${{ github.workspace }}/.cache
5555
${{ github.workspace }}/dash/depends/built
5656
${{ github.workspace }}/dash/depends/sources
5757
${{ github.workspace }}/dash/depends/work
58-
key: ${{ runner.os }}-guix
58+
key: ${{ runner.os }}-guix-${{ github.event.pull_request.head.sha }}
59+
restore-keys: |
60+
${{ runner.os }}-guix-${{ github.event.pull_request.head.sha }}
61+
${{ runner.os }}-guix-
62+
63+
5964
6065
- name: Create .cache folder if missing
6166
if: steps.guix-cache-restore.outputs.cache-hit != 'true'
@@ -80,17 +85,6 @@ jobs:
8085
exit 1
8186
fi
8287
83-
- name: Save Guix cache and depends
84-
id: guix-cache-save
85-
uses: actions/cache/save@v3
86-
with:
87-
path: |
88-
${{ github.workspace }}/.cache
89-
${{ github.workspace }}/dash/depends/built
90-
${{ github.workspace }}/dash/depends/sources
91-
${{ github.workspace }}/dash/depends/work
92-
key: ${{ steps.guix-cache-restore.outputs.cache-primary-key }}
93-
9488
- name: Compute SHA256 checksums
9589
run: |
9690
./dash/contrib/containers/guix/scripts/guix-check ${{ github.workspace }}/dash

0 commit comments

Comments
 (0)