Skip to content

Commit 4f8a2d8

Browse files
committed
gha - save-always is deprecated in actions/cache@v4
So use restore and save steps correctly
1 parent 9204b9b commit 4f8a2d8

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/actions/cache-typst/action.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
name: "Cache Typst package"
1+
name: "Restore any Typst package cache"
22
description: "Configures the caching for Typst packages"
3+
outputs:
4+
cache-hit:
5+
description: "Is there a cache restored ?"
6+
value: ${{ steps.cache-typst-restore.outputs.cache-hit }}
7+
cache-key:
8+
description: "Key of the cache considered"
9+
value: ${{ steps.cache-typst-restore.outputs.cache-primary-key }}
10+
cache-path:
11+
description: "where is the packages cache for typst ?"
12+
value: ${{ steps.cache-typst-path.outputs.TYPST_CACHE }}
313

414
runs:
515
using: "composite"
616
steps:
717
- name: Typst Cache path
18+
id: cache-typst-path
819
run: |
920
case $RUNNER_OS in
1021
"Linux")
@@ -21,13 +32,12 @@ runs:
2132
exit 1
2233
;;
2334
esac
35+
echo "TYPST_CACHE=${TYPST_CACHE}" >> $GITHUB_OUTPUT
2436
shell: bash
2537

2638
- name: Cache Typst package folder
27-
uses: actions/cache@v4
39+
id: cache-typst-restore
40+
uses: actions/cache/restore@v4
2841
with:
2942
path: ${{ env.TYPST_CACHE }}
30-
key: ${{ runner.os }}-typst-1-${{ github.run_id }}
31-
restore-keys: |
32-
${{ runner.os }}-typst-1-
33-
save-always: true
43+
key: ${{ runner.os }}-typst-1

.github/workflows/test-smokes.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
quarto install tinytex
162162
163163
- name: Cache Typst packages
164+
id: cache-typst
164165
uses: ./.github/actions/cache-typst
165166

166167
- name: Install Chrome
@@ -289,6 +290,12 @@ jobs:
289290
name: timed test file
290291
path: tests/timing-for-ci.txt
291292

293+
- name: Save Typst cache
294+
if: always()
295+
uses: actions/cache/save@v4
296+
with:
297+
key: ${{ steps.cache-typst.outputs.cache-key }}
298+
292299
- uses: actions/upload-artifact@v4
293300
# PLaywright test only runs on Linux for now
294301
if: ${{ !cancelled() && runner.os != 'Windows' }}

0 commit comments

Comments
 (0)