Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/actions/cache-typst/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
name: "Cache Typst package"
name: "Restore any Typst package cache"
description: "Configures the caching for Typst packages"
outputs:
cache-hit:
description: "Was a cache found with primary key ?"
value: ${{ steps.cache-typst-restore.outputs.cache-hit }}
cache-primary-key:
description: "Key of the cache to find and save"
value: ${{ steps.cache-typst-restore.outputs.cache-primary-key }}
cache-matched-key:
description: "Key of the cache found and used."
value: ${{ steps.cache-typst-restore.outputs.cache-primary-key }}
cache-path:
description: "where is the packages cache for typst ?"
value: ${{ steps.cache-typst-path.outputs.TYPST_CACHE }}

runs:
using: "composite"
steps:
- name: Typst Cache path
id: cache-typst-path
run: |
case $RUNNER_OS in
"Linux")
Expand All @@ -21,13 +35,14 @@ runs:
exit 1
;;
esac
echo "TYPST_CACHE=${TYPST_CACHE}" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Typst package folder
uses: actions/cache@v4
id: cache-typst-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.TYPST_CACHE }}
key: ${{ runner.os }}-typst-1-${{ github.run_id }}
key: ${{ runner.os }}-typst-1
restore-keys: |
${{ runner.os }}-typst-1-
save-always: true
${{ runner.os }}-typst-
8 changes: 8 additions & 0 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ jobs:
quarto install tinytex

- name: Cache Typst packages
id: cache-typst
uses: ./.github/actions/cache-typst

- name: Install Chrome
Expand Down Expand Up @@ -289,6 +290,13 @@ jobs:
name: timed test file
path: tests/timing-for-ci.txt

- name: Save Typst cache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-typst.outputs.cache-primary-key }}
path: ${{ steps.cache-typst.outputs.cache-path }}

- uses: actions/upload-artifact@v4
# PLaywright test only runs on Linux for now
if: ${{ !cancelled() && runner.os != 'Windows' }}
Expand Down
Loading