-
Notifications
You must be signed in to change notification settings - Fork 23
345 lines (293 loc) · 9.73 KB
/
Copy pathci.yml
File metadata and controls
345 lines (293 loc) · 9.73 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
typst:
name: Typst documents (${{ matrix.profile }}, Ubuntu)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
profile: [debug, release]
timeout-minutes: 45
permissions:
contents: read
env:
PYTHONUTF8: '1'
CARGO_INCREMENTAL: '0'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout pinned Typst reporter
uses: actions/checkout@v4
with:
repository: LDemetrios/typst-shared-library
# cargo-jvm-experiment revision used to reproduce issue #61.
ref: 55b485f923034f90792cb065ee68bf9f5856bdeb
path: target/typst/source
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Read pinned Rust toolchain
id: rust-toolchain
shell: bash
run: |
python - <<'PY'
import os, tomllib
with open("rust-toolchain.toml", "rb") as file:
toolchain = tomllib.load(file)["toolchain"]
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
output.write(f"channel={toolchain['channel']}\n")
output.write(f"components={','.join(toolchain.get('components', []))}\n")
PY
- name: Set up pinned Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-toolchain.outputs.channel }}
components: ${{ steps.rust-toolchain.outputs.components }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: typst
cache-targets: false
- name: Build backend and tools
run: python build.py ci
- name: Compile and render Typst documents
run: python tests/typst/run.py ${{ matrix.profile == 'release' && '--release' || '' }}
- name: Upload Typst output and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: typst-documents-${{ matrix.profile }}
path: target/typst/reports/
if-no-files-found: warn
self-tests:
name: self-tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu
os: ubuntu-latest
- name: Windows
os: windows-latest
env:
PYTHONUTF8: '1'
steps:
- name: Enable Git symlinks on Windows
if: runner.os == 'Windows'
shell: pwsh
run: git config --global core.symlinks true
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Read pinned Rust toolchain
id: rust-toolchain
shell: bash
run: |
python - <<'PY'
import os, tomllib
with open("rust-toolchain.toml", "rb") as file:
toolchain = tomllib.load(file)["toolchain"]
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
output.write(f"channel={toolchain['channel']}\n")
output.write(f"components={','.join(toolchain.get('components', []))}\n")
PY
- name: Set up pinned Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-toolchain.outputs.channel }}
components: ${{ steps.rust-toolchain.outputs.components }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
- name: Set up Kotlin
run: python tests/kotlin/install_kotlin.py --github-path
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
with:
# Older caches contain source overlays that the action treats as build artifacts.
prefix-key: self-tests-artifacts-v1
- name: Build backend and tools
run: python build.py ci
- name: Run compiler unit tests
id: compiler_unit_tests
continue-on-error: true
shell: bash
run: |
cargo test
cargo test --manifest-path compiler-core/Cargo.toml
cargo test --manifest-path java-linker/Cargo.toml
- name: Check JVM binding macros
id: jvm_macro_tests
continue-on-error: true
shell: bash
run: |
cargo fmt --manifest-path jvm/Cargo.toml --check
cargo test --manifest-path jvm/Cargo.toml
- name: Run self-tests (debug)
id: self_tests_debug
continue-on-error: true
run: python Tester.py
- name: Run self-tests (release)
id: self_tests_release
continue-on-error: true
run: python Tester.py --release
- name: Remove generated sources before caching build artifacts
if: always()
run: python -c "from pathlib import Path; import shutil; p = Path('target/stdlib-overlay'); p.exists() and shutil.rmtree(p)"
- name: Require 100% self-test pass rate
if: >-
always() &&
(
steps.compiler_unit_tests.outcome != 'success' ||
steps.jvm_macro_tests.outcome != 'success' ||
steps.self_tests_debug.outcome != 'success' ||
steps.self_tests_release.outcome != 'success'
)
run: python -c "raise SystemExit('compiler, macro, debug, and release tests must pass completely')"
coretests:
name: coretests (Ubuntu)
runs-on: ubuntu-latest
timeout-minutes: 360
env:
PYTHONUTF8: '1'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Read pinned Rust toolchain
id: rust-toolchain
shell: bash
run: |
python - <<'PY'
import os, tomllib
with open("rust-toolchain.toml", "rb") as file:
toolchain = tomllib.load(file)["toolchain"]
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
output.write(f"channel={toolchain['channel']}\n")
output.write(f"components={','.join(toolchain.get('components', []))}\n")
PY
- name: Set up pinned Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-toolchain.outputs.channel }}
components: ${{ steps.rust-toolchain.outputs.components }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Build backend and tools
run: python build.py ci
- name: Run coretests (debug)
id: coretests_debug
continue-on-error: true
run: python Coretests.py --timeout 20 --build-timeout 1200
- name: Run coretests (release)
id: coretests_release
continue-on-error: true
run: python Coretests.py --release --timeout 20 --build-timeout 1200
- name: Upload coretests reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coretests
path: |
target/coretests/reports/
target/coretests/logs/
if-no-files-found: error
- name: Require 100% coretests pass rate
if: >-
always() &&
(
steps.coretests_debug.outcome != 'success' ||
steps.coretests_release.outcome != 'success'
)
run: python -c "raise SystemExit('debug and release coretests must both pass completely')"
alloctests:
name: alloctests (Ubuntu)
runs-on: ubuntu-latest
timeout-minutes: 360
env:
PYTHONUTF8: '1'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Read pinned Rust toolchain
id: rust-toolchain
shell: bash
run: |
python - <<'PY'
import os, tomllib
with open("rust-toolchain.toml", "rb") as file:
toolchain = tomllib.load(file)["toolchain"]
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
output.write(f"channel={toolchain['channel']}\n")
output.write(f"components={','.join(toolchain.get('components', []))}\n")
PY
- name: Set up pinned Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-toolchain.outputs.channel }}
components: ${{ steps.rust-toolchain.outputs.components }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Build backend and tools
run: python build.py ci
- name: Run alloctests (debug)
id: alloctests_debug
continue-on-error: true
run: python Alloctests.py --timeout 120 --build-timeout 1200
- name: Run alloctests (release)
id: alloctests_release
continue-on-error: true
run: python Alloctests.py --release --timeout 120 --build-timeout 1200
- name: Upload alloctests reports
if: always()
uses: actions/upload-artifact@v4
with:
name: alloctests
path: |
target/alloctests/reports/
target/alloctests/logs/
if-no-files-found: error
- name: Require 100% alloctests pass rate
if: >-
always() &&
(
steps.alloctests_debug.outcome != 'success' ||
steps.alloctests_release.outcome != 'success'
)
run: python -c "raise SystemExit('debug and release alloctests must both pass completely')"