-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (115 loc) · 2.93 KB
/
e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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