Repository navigation
338 lines (337 loc) · 13.3 KB
/
Copy pathverify.yml
File metadata and controls
338 lines (337 loc) · 13.3 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
name: Verify
on:
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-verify-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
binding:
name: Binding
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Cache Rust builds
uses: wevm/actions/vendor/Swatinem/rust-cache/v2.9.2@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build compiler binding
run: pnpm build:binding:test
- name: Upload compiler binding
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
if-no-files-found: error
name: binding
path: |
binding/*.node
binding/compiler.wasm
src/web/internal/Wasm.generated.ts
retention-days: 1
timeout-minutes: 30
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Cache Rust builds
uses: wevm/actions/vendor/Swatinem/rust-cache/v2.9.2@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build package
run: pnpm build
timeout-minutes: 30
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Check code
run: pnpm check
- name: Check native inventory
run: pnpm check:native >> "$GITHUB_STEP_SUMMARY"
- name: Check at-rule inventory
run: pnpm check:at-rules >> "$GITHUB_STEP_SUMMARY"
- name: Check Base UI inventory
run: pnpm check:base-ui >> "$GITHUB_STEP_SUMMARY"
- name: Check generated Rust tables
run: pnpm check:tables
conformance:
name: CSS Conformance
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Enforce complete property conformance
run: |
set -o pipefail
pnpm check:css:full 2>&1 | tee css-conformance.md
- if: ${{ always() }}
name: Publish conformance summary
run: cat css-conformance.md >> "$GITHUB_STEP_SUMMARY"
- if: ${{ always() && hashFiles('css-conformance.md') != '' }}
name: Upload conformance report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: css-conformance
path: css-conformance.md
retention-days: 30
rust:
name: Rust
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Cache Rust builds
uses: wevm/actions/vendor/Swatinem/rust-cache/v2.9.2@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check formatting
run: cargo fmt --all --check
- name: Lint crates
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Lint the web-only compiler
run: cargo clippy --package compiler --no-default-features --all-targets -- -D warnings
- name: Lint the WebAssembly build
run: cargo clippy --package wasm --target wasm32-wasip1 -- -D warnings
- name: Test crates
run: cargo test --workspace
timeout-minutes: 30
wasi:
name: WebAssembly binding
needs: [binding]
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Cache Rust builds
uses: wevm/actions/vendor/Swatinem/rust-cache/v2.9.2@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Download compiler binding
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: binding
- name: Build WebAssembly binding
run: pnpm build:binding:wasi
- name: Build package for the packed fallback
run: pnpm build:package
- name: Compare with the native addon
run: pnpm check:wasi
timeout-minutes: 30
test-shards:
name: Test (${{ matrix.shard }}/16)
needs: [binding]
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Remove Microsoft package sources
# Some runner images list an unsigned packages.microsoft.com source, which fails `apt-get update`.
# No step installs a package from it.
run: grep -rl packages.microsoft.com /etc/apt/sources.list.d | xargs -r sudo rm -f
- name: Install browser
run: pnpm exec playwright install --with-deps --only-shell chromium
- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
cache: pip
cache-dependency-path: test/conformance/requirements.txt
python-version: '3.12'
- name: Install print engine
run: |
sudo apt-get update
sudo apt-get install -y libpango-1.0-0 libpangoft2-1.0-0 poppler-utils
python -m pip install -r test/conformance/requirements.txt
- name: Download compiler binding
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: binding
- name: Build package for integration consumers
run: pnpm build:package
- env:
CI: true
ZYZZ_BINDING: prebuilt
name: Run tests
run: |
pnpm run test run --shard=${{ matrix.shard }}/16 --coverage --reporter=default --reporter=blob --outputFile.blob=test-results/blob-${{ matrix.shard }}.json
- name: Upload shard results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
if-no-files-found: error
include-hidden-files: true
name: test-shard-${{ matrix.shard }}
path: |
test-results/
coverage/
retention-days: 1
timeout-minutes: 30
test:
name: Test
if: ${{ !cancelled() }}
needs: [test-shards, typescript]
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Download shard results
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: test-shard-*
merge-multiple: true
- name: Require all shards and type checks
env:
SHARDS_RESULT: ${{ needs.test-shards.result }}
TYPES_RESULT: ${{ needs.typescript.result }}
run: |
test "$SHARDS_RESULT" = success
test "$TYPES_RESULT" = success
for shard in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do test -f "test-results/blob-$shard.json"; done
- name: Merge test results and coverage
if: ${{ !cancelled() }}
run: |
mkdir -p test-results/blobs
mv test-results/blob-*.json test-results/blobs/
pnpm run test run --merge-reports=test-results/blobs --coverage --reporter=default --reporter=json --outputFile=test-results/integration.json
- env:
NODE_OPTIONS: --max-old-space-size=4096
name: Enforce full at-rule compiler acceptance
run: node scripts/at-rule-acceptance.ts --require-full --require-targets --results test-results/integration.json
- if: ${{ !cancelled() && hashFiles('test-results/at-rule-target-retention.json') != '' }}
name: Upload at-rule target review
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: at-rule-target-retention
path: test-results/at-rule-target-retention.json
retention-days: 30
- if: ${{ !cancelled() && hashFiles('test-results/at-rule-print-capabilities.json') != '' }}
name: Upload print capabilities
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: at-rule-print-capabilities
path: test-results/at-rule-print-capabilities.json
retention-days: 30
- if: ${{ failure() && hashFiles('test-results/next-*.json') != '' }}
name: Upload Next.js failure evidence
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: next-failure-evidence
path: test-results/next-*.json
retention-days: 30
- if: ${{ !cancelled() && hashFiles('coverage/coverage-summary.json') != '' }}
name: Report coverage
uses: wevm/actions/vendor/davelosert/vitest-coverage-report-action/v2.13.1@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
comment-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && 'pr' || 'none' }}
file-coverage-mode: all
name: Integration Tests
- if: ${{ !cancelled() && hashFiles('coverage/coverage-summary.json') != '' }}
name: Upload coverage
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage
path: coverage/
retention-days: 30
- if: ${{ !cancelled() && hashFiles('test-results/css-browser-capabilities.json') != '' }}
name: Upload CSS browser capabilities
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: css-browser-capabilities
path: test-results/css-browser-capabilities.json
retention-days: 30
- if: ${{ failure() && hashFiles('test-results/css-consumer-*.test-d.ts') != '' }}
name: Upload failing CSS consumer
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: css-consumer
path: test-results/css-consumer-*.test-d.ts
retention-days: 30
- if: ${{ !cancelled() && hashFiles('test-results/at-rule-browser-capabilities.json') != '' }}
name: Upload at-rule browser capabilities
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: at-rule-browser-capabilities
path: test-results/at-rule-browser-capabilities.json
retention-days: 30
typescript:
name: Types (typescript@7)
env:
NODE_OPTIONS: --max-old-space-size=4096
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install dependencies
uses: $/.github/actions/install-dependencies
- name: Check types
run: |
set -o pipefail
pnpm exec tsc --extendedDiagnostics | tee typescript-diagnostics.txt
{
printf '## TypeScript %s type check\n\n```\n' "$(pnpm exec tsc --version | sed 's/^Version //')"
cat typescript-diagnostics.txt
printf '```\n'
} >> "$GITHUB_STEP_SUMMARY"
timeout-minutes: 45
zizmor:
name: Actions security
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Audit GitHub Actions
uses: wevm/actions/vendor/zizmorcore/zizmor-action/v0.7.0@73e899a58d51092d694fbaf94b7a1d8c09bfea28
with:
advanced-security: false
annotations: true
inputs: .github
version: '1.31.0'
timeout-minutes: 5
permissions:
contents: read