Switch to stable install-texlive action #216
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automated testing | |
# Currently we run in two situations: | |
on: | |
# Whenever someone pushes to a branch or tag in our repo | |
push: | |
branches: | |
- "*" | |
# Whenever a pull request is opened, reopened or gets new commits. | |
pull_request: | |
# This implies that for every push to a local branch in our repo for which a | |
# pull request is open this runs twice. But it's important to ensure that pull | |
# requests get tested even if their branch comes from a fork. | |
jobs: | |
# The l3build job contains the actual work. We misuse the matrix mechanism to | |
# create three jobs which only differ in minimal elements. | |
l3build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
# include indicates that we want to set explicitly these combinations | |
# and don't want full matrix testing. | |
# "name" is just to make the output more readable. | |
# "l3build_cmd" is the actual command to run | |
# "artifact_name" is which artifact might get generated by this step. | |
# IMPORTANT: artifact_name == "Documentation" is used as a trigger to | |
# generate the artifact from PDF files and not the build directory and | |
# to generate the artifact when the run is successful, not when it fails. | |
include: | |
- name: "Test suite" | |
l3build_cmd: l3build check -q -H --show-log-on-error | |
artifact_name: testfiles | |
- name: "Documentation" | |
l3build_cmd: l3build doc -q -H | |
artifact_name: Documentation | |
name: ${{matrix.name }} | |
steps: | |
# Boilerplate | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# We need docutils for our documentation | |
- run: sudo apt-get install python3-docutils | |
- name: Install TeX Live | |
uses: zauguin/install-texlive@v3 | |
with: | |
# The list of packages to install is in a separate file under .github/tl_packages | |
# to allow reuse. | |
package_file: .github/tl_packages | |
cache_version: 0 | |
- name: Run l3build | |
run: ${{ matrix.l3build_cmd }} | |
# Now we create the artifacts: There are two cases where this happens. | |
# 1. If we failed running tests | |
- name: Archive failed test output | |
if: ${{ always() }} | |
uses: zauguin/l3build-failure-artifacts@v1 | |
with: | |
name: ${{ matrix.artifact_name }} | |
# Decide how long to keep the test output artifact: | |
retention-days: 3 | |
# 2. If we succeed building documentation | |
- name: Archive documentation | |
if: ${{ matrix.artifact_name == 'Documentation' && success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: "**/*.pdf" | |
# Decide how long to keep the test output artifact: | |
retention-days: 21 | |
windows: | |
runs-on: windows-latest | |
name: Tests on Windows | |
steps: | |
# Boilerplate | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install TeX Live | |
uses: zauguin/install-texlive@v3 | |
with: | |
# The list of packages to install is in a separate file under .github/tl_packages | |
# to allow reuse. | |
package_file: .github/tl_packages | |
cache_version: 0 | |
- name: Run l3build | |
run: l3build check -q -H --show-log-on-error | |
# Now we create the artifacts: There are two cases where this happens. | |
# 1. If we failed running tests | |
- name: Archive failed test output | |
if: ${{ always() }} | |
uses: zauguin/l3build-failure-artifacts@v1 | |
with: | |
name: ${{ matrix.artifact_name }} | |
# Decide how long to keep the test output artifact: | |
retention-days: 3 | |
# GitHub automatically informs the initiator of any action about the result, but | |
# we additionally want to keep the latex-commits mailing list informed about | |
# test failures. | |
notifiy: | |
name: Send notifications | |
runs-on: ubuntu-20.04 | |
# Run after the `l3build` job in order to be able to react to it's output. | |
needs: l3build | |
# Only run if the tests failed, we don't want to get notifications for every run. | |
# We don't want information for pull requests since for pull requests from local | |
# branches we already send notifications when the branch test fails and pull requests | |
# from forks can't access the username and password secrets required to send mails. | |
if: ${{ failure() && github.event_name != 'pull_request' }} | |
steps: | |
- name: Send mail | |
# The explicit commit hash ensures that this can't be used by dawidd6 as a | |
# backdoor to execute arbitrary code during our runs. | |
uses: dawidd6/action-send-mail@4226df7daafa6fc901a43789c49bf7ab309066e7 | |
with: | |
# Currently using my (Marcel's) mail server for sending mails. | |
server_address: typesetting.eu | |
server_port: 587 | |
# These values can be changed in the repository settings. | |
username: ${{secrets.MAIL_USERNAME}} | |
password: ${{secrets.MAIL_PASSWORD}} | |
# If we want to send notifications to additional addresses, at them here as | |
# a comma separated list. | |
to: [email protected] | |
# The name is arbitrary, but if you want to change the address you need to | |
# coordinate it with the administrator of the mail server to allow the account | |
# to send from the mail address. | |
from: LaTeX CI <[email protected]> | |
priority: high | |
# Determine the subject and body of the mail. | |
subject: "Test failed: ${{github.repository}} (${{github.ref}})" | |
body: | | |
Test failure for ${{github.repository}} | |
------------------------------------------------------------- | |
On branch: ${{github.ref}} (${{github.sha}}) | |
Initiated by: ${{github.actor}} | |
Commit URL: https://github.com/${{github.repository}}/commit/${{github.sha}} | |
More information: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |