chore: tweak #9
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: E2E | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'dist/**' | |
- '!**/*.md' | |
- action.yml | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
save-cache: | |
strategy: | |
matrix: | |
os: [ubuntu, windows, macos] | |
fail-fast: false | |
runs-on: ${{ matrix.os }}-latest | |
outputs: | |
ubuntu: ${{ steps.status.outputs.ubuntu || '' }} | |
windows: ${{ steps.status.outputs.windows || '' }} | |
macos: ${{ steps.status.outputs.macos || '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup TeX Live | |
id: setup | |
uses: ./ | |
- name: Check that a new installation has been made | |
if: fromJSON(steps.setup.outputs.cache-restored) | |
run: exit 1 | |
- run: tlmgr version | |
- name: Set output | |
id: status | |
shell: bash | |
run: | | |
echo "${MATRIX_OS}=${MATRIX_OS}" >> "${GITHUB_OUTPUT}" | |
env: | |
MATRIX_OS: ${{ matrix.os }} | |
restore-cache: | |
needs: save-cache | |
if: | | |
!cancelled() && ( | |
needs.save-cache.outputs.ubuntu || | |
needs.save-cache.outputs.windows || | |
needs.save-cache.outputs.macos | |
) | |
strategy: | |
matrix: | |
os: | |
- ${{ needs.save-cache.outputs.ubuntu }} | |
- ${{ needs.save-cache.outputs.windows }} | |
- ${{ needs.save-cache.outputs.macos }} | |
exclude: | |
- os: '' | |
fail-fast: false | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup TeX Live | |
id: setup | |
uses: ./ | |
- name: Check that the cache is exactly matched | |
if: ${{ !fromJSON(steps.setup.outputs.cache-hit) }} | |
run: exit 1 | |
- run: tlmgr version | |
delete-caches: | |
needs: restore-cache | |
if: >- | |
always() && | |
github.actor != 'nektos/act' | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: read | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install package | |
run: >- | |
npm ci | |
--omit=dev | |
--engine-strict=false | |
--ignore-scripts | |
-w packages/e2e | |
- uses: actions/github-script@v7 | |
with: | |
script: | | |
const { deleteCaches } = require('@setup-texlive-action/e2e'); | |
await deleteCaches({ context, core, github }); | |
compile: | |
strategy: | |
matrix: | |
os: [ubuntu, windows, macos] | |
fail-fast: false | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup TeX Live | |
uses: ./ | |
with: | |
cache: false | |
package-file: | | |
**/tl_packages | |
**/DEPENDS.txt | |
packages: latex-bin | |
- name: Compile | |
shell: bash -e {0} | |
run: | | |
pdflatex -halt-on-error << 'EOF' | |
\documentclass{article} | |
\usepackage[language=english]{lipsum} | |
\begin{document} | |
\lipsum | |
\end{document} | |
EOF |