Skip to content

Commit

Permalink
ci: move cache update into main job
Browse files Browse the repository at this point in the history
  • Loading branch information
muzimuzhi committed Jan 19, 2025
1 parent c51c24c commit b5aa486
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 43 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Based on https://github.com/CTeX-org/ctex-kit/blob/master/.github/workflows/test.yml

name: Test suite

on:
Expand Down Expand Up @@ -27,10 +25,28 @@ jobs:
name: "Tests: ${{ matrix.config }}\
${{ matrix.option != '' && ' (latex-dev)' || '' }}"
runs-on: ubuntu-latest
permissions:
actions: write # for "gh cache delete"

steps:
- uses: actions/checkout@v4

- name: Delete TeX Live cache(s)
if: github.event_name == 'schedule'
# https://cli.github.com/manual/gh_cache_list
# https://cli.github.com/manual/gh_cache_delete
run: |
# to find why 'cache_keys' might contain dup items
set -x
cache_keys=$(\
gh cache list --key setup-texlive --json key --jq '.[].key')
for key in $cache_keys; do
echo "Deleting cache \"$key\""
gh cache delete "$key"
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup TeX Live
# v3.3.4 is too sensitive to cache update
# https://github.com/teatimeguest/setup-texlive-action/issues/329#issuecomment-2518562909
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/update-cache.yml

This file was deleted.

0 comments on commit b5aa486

Please sign in to comment.