Skip to content

Test suite

Test suite #164

Workflow file for this run

name: Test suite
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:
schedule:
# at 12:21 UTC (20:21 CST/UTC +8) on every Friday
# https://crontab.guru/#21_12_*_*_5
- cron: "21 12 * * 5"
workflow_dispatch:
inputs:
update-cache:
description: "If update the TeX live cache"
type: boolean
default: false
jobs:
tests:
strategy:
matrix:
config: ["build", "config-old"]
# TODO: find a way to handle different testfiles when checking
# with latex and latex-dev
# option: ["", "--dev"]
option: [""]
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' || inputs.update-cache
# 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
uses: teatimeguest/[email protected]
with:
package-file: .github/tl_packages
update-all-packages: true
# imagemagick is pre-installed on Ubuntu 22.04 image
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#installed-apt-packages
- name: Install ppmcheckpdf dependencies
if: matrix.config == 'config-old'
# actively maintained
uses: gerlero/apt-install@v1
with:
packages: imagemagick poppler-utils
- name: Run zutil tests
if: matrix.config == 'build'
run: |
cd zutil
l3build check \
--halt-on-error --show-saves \
${{ matrix.option }}
- name: Run tabularray tests
run: |
cd tabularray
l3build check \
-c${{ matrix.config }} --halt-on-error --show-saves \
${{ matrix.option }}
- name: Check tabularray tests with ppmcheckpdf
if: matrix.config == 'config-old'
run: |
cd tabularray
texlua buildend.lua
# 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@v4
with:
# example names:
# - tblr-diffs
# - tblr-diffs-dev
# - tblr-diffs-config-old
# - tblr-diffs-config-old-dev
name: "tblr-diffs\
${{ matrix.config != '' && format('-{0}', matrix.config) || '' }}\
${{ matrix.option != '' && '-dev' || '' }}"
path: |
build/**/*.diff
build/**/*.diff.png