Skip to content

chore(deps): update actions/checkout action to v7 #759

chore(deps): update actions/checkout action to v7

chore(deps): update actions/checkout action to v7 #759

Workflow file for this run

name: Check
run-name: ${{ contains(fromJSON('["workflow_call", "workflow_dispatch"]'), github.event_name) && format('Check ({0})', github.event_name) || ''}}
on:
pull_request:
types:
# added "ready_for_review"
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
[opened, ready_for_review, reopened, synchronize]
push:
paths-ignore:
- ".github/workflows/schedule.yml"
- ".github/workflows/lint.yml"
- ".pre-commit-config.yaml"
workflow_call:
# yaml anchor is supported in Aug, 2025
# https://github.com/actions/runner/issues/1182
inputs: &inputs
images:
description: "Array of images to run on"
required: false
type: string
default: '["ubuntu-latest"]'
install-texlive-cleanly:
description: "Install TeX live from scratch?"
required: false
type: boolean
default: false
update-texlive-packages:
description: "Update TeX Live packages?"
required: false
type: boolean
default: true
test-inactive:
description: "Run tests for inactive packages?"
required: false
type: boolean
default: false
workflow_dispatch:
inputs: *inputs
jobs:
check:
strategy:
fail-fast: false
matrix:
# TODO: find a way to handle different testfiles when checking
# with latex and latex-dev
# options: ["", "--dev"]
options: [""]
# only `workflow_call` and `workflow_dispatch` would set `inputs`
# context
runs-on: ${{ fromJSON(inputs.images || '["ubuntu-latest"]') }}
# example `name`s:
# - Check (ubuntu-latest)
# - Check (ubuntu-latest, --dev)
name: "Check (\
${{ inputs && format('{0}', matrix.runs-on) || '' }}\
${{ matrix.options && format(', {0}', matrix.options) || '' }})"
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 30
permissions:
# required for for "gh cache delete"
# https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
# Overwrite the default `pwsh` shell on Windows, to get consistent
# fast-fail behavior on all OSes.
# GitHub Actions only configs PowerShell to fast-fail on cmdlets, (by
# setting `$ErrorActionPreference = 'Stop'`), but not on native commands,
# which needs also
# `PSNativeCommandUseErrorActionPreference = $true` (PowerShell v7.3+).
# See
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#exit-codes-and-error-action-preference
# https://github.com/actions/runner-images/issues/6668
# https://github.com/actions/runner-images/issues/8900
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables
defaults:
run:
shell: bash
env:
L3BUILD_CHECK_OPTIONS: >-
--halt-on-error --show-log-on-error --show-saves ${{ matrix.options }}
steps:
- uses: actions/checkout@v7
- name: Delete TeX Live cache(s)
if: inputs.install-texlive-cleanly
# https://cli.github.com/manual/gh_cache_list
# https://cli.github.com/manual/gh_cache_delete
# "shellcheck disable=..." directive used at top doesn't work, see
# https://github.com/rhysd/actionlint/issues/237
# shellcheck ignore doc
# https://github.com/koalaman/shellcheck/wiki/Ignore
run: |
# emulate TeX-Live/setup-texlive-action cache key prefix
prefix="setup-texlive-action"
# shellcheck disable=SC2016
prefix="$prefix\
-$(node -e 'console.log(`${os.platform()}-${os.arch()}`)')"
echo "prefix=$prefix"
caches=()
while IFS= read -r line; do
caches+=( "$line" )
done < <(gh cache list \
--key "$prefix" --json id,key --jq '.[] | .id, .key')
# cache id is unique; cache key may not
# branches may have different caches using the same cache key
for ((i=0; i<${#caches[@]}; i+=2)); do
id=${caches[i]}
key=${caches[i+1]}
echo "Deleting cache with id \"$id\", key \"$key\""
gh cache delete "$id"
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup TeX Live
uses: TeX-Live/setup-texlive-action@v4
with:
package-file: .github/tl_packages
update-all-packages: ${{ inputs.update-texlive-packages || true }}
- name: Install just
uses: taiki-e/install-action@v2
with:
# supported tools
# https://github.com/taiki-e/install-action/blob/main/TOOLS.md
tool: |
just
fallback: none
- name: Install uv
# since v8.0.0, astral-sh/setup-uv stopped providing major and minor tags
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: false
- name: Install l3build-wrapper
# no need for `-e, --editable` installation
run: |
cd l3build-wrapper
uv tool install .
- name: Install ppmcheckpdf dependencies
if: inputs.test-inactive
uses: muzimuzhi/actions/ppmcheckpdf-deps@main
# uses "L3BUILD_CHECK_OPTIONS" job env
- name: Run active l3build tests
run: |
just test
# uses "L3BUILD_CHECK_OPTIONS" job env
- name: Run inactive l3build tests
if: inputs.test-inactive
run: |
just test-inactive
# TODO: generate a list of files related to failed tests, then
# upload all of them (.tex, .log, .pdf, .png, .md5, etc.)
- name: Upload diff files
if: failure()
uses: actions/upload-artifact@v7
with:
# example names:
# - zutil-diffs
# - zutil-diffs-dev
name: "zutil-diffs-\
${{ matrix.options != '' && '-dev' || '' }}"
# configured in justfile, l3build uses OS-independent diff file extension
path: |
build/**/*.diff
build/**/*.diff.png