forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
613 lines (567 loc) · 24.3 KB
/
ci.yml
File metadata and controls
613 lines (567 loc) · 24.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
name: CI
permissions: {}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
branches-ignore:
- "**/graphite-base/**"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
test-ubuntu:
name: Test Linux
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- run: cargo ck
- run: cargo test --all-features
- run: git diff --exit-code # Must commit everything
test-ubuntu-aarch64:
if: ${{ github.ref_name == 'main' }}
name: Test Linux ARM64
runs-on: ubuntu-24.04-arm
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
with:
save-cache: ${{ github.ref_name == 'main' }}
cache-key: warm-aarch64
- run: cargo ck
- run: cargo test --all-features
- run: git diff --exit-code # Must commit everything
test-mac: # Separate job to save a job on PRs
if: ${{ github.ref_name == 'main' }}
name: Test Mac
runs-on: namespace-profile-mac-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
cache: |
rust
pnpm
- run: cargo ck
- run: cargo test --all-features
- run: git diff --exit-code # Must commit everything
test-windows:
if: ${{ github.ref_name == 'main' }}
name: Test Windows
runs-on: windows-latest
steps:
- run: git config --system core.longpaths true
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
# Unsung heroes of the internet, who led me here to speed up Windows' slowness:
# https://github.com/actions/cache/issues/752#issuecomment-1847036770
# https://github.com/astral-sh/uv/blob/502e04200d52de30d3159894833b3db4f0d6644d/.github/workflows/ci.yml#L158
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
with:
workspace-copy: true
drive-size: 12GB
drive-format: ReFS
env-mapping: |
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
- name: Install Rust
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
shell: bash
run: |
# This `awk` command will find the value of our Minimum Supported Rust Version and store it as `MSRV`.
# NOTE: this will fail if there are any other items named `rust-version`. We assume there is only one in our `Cargo.toml`.
MSRV=$(awk -F'=' '/rust-version/ {gsub(/[" ]/, "", $2); printf "%s", ($2 + "")}' Cargo.toml)
# Set profile to minimal and channel to our Minimum Supported Rust Version.
# Running our tests on this channel ensures that our code uses APIs that are supported in our `MSRV`.
sed -i -e 's/profile = "default"/profile = "minimal"/g' -e "s/channel = .*/channel = \"$MSRV\"/g" rust-toolchain.toml
rustup set profile minimal
rustup show
git restore .
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: ${{ env.DEV_DRIVE_WORKSPACE }}
save-if: ${{ github.ref_name == 'main' }}
shared-key: windows-latest
- name: Run tests
# No need for `cargo ck` because it's already checked in linux
# Run `website` tests separately to avoid feature unification problems with `oxlint`
run: cargo test --all-features
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
shell: bash
test-big-endian:
if: ${{ github.ref_name == 'main' }}
name: Test big-endian # s390x-unknown-linux-gnu is a big-endian
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1
with:
tool: cross
# `--lib --bins --tests` to skip doctests which are very slow to run via `cross`.
# https://github.com/cross-rs/cross/issues/1703
- run: cross test --lib --bins --tests --all-features --target s390x-unknown-linux-gnu
test-32bit:
if: ${{ github.ref_name == 'main' }}
name: Test 32-bit # armv7-unknown-linux-gnueabihf is a 32-bit target
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1
with:
tool: cross
# `--lib --bins --tests` to skip doctests which are very slow to run via `cross`.
# https://github.com/cross-rs/cross/issues/1703
- run: cross test --workspace --lib --bins --tests --all-features --exclude oxc_language_server --exclude oxc_linter --exclude oxlint --target armv7-unknown-linux-gnueabihf
test-wasm32-wasip1-threads:
name: Test wasm32-wasip1-threads
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
exclude: oxc_linter
paths: napi/,npm/,apps/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- name: Build
if: steps.filter.outputs.changed == 'true'
run: |
rustup target add wasm32-wasip1-threads
pnpm run build-wasm-dev
git diff --exit-code # Must commit everything
- name: Test wasi in browser
if: steps.filter.outputs.changed == 'true'
working-directory: napi/parser
run: |
rm -rf *.wasm
pnpm exec playwright install chromium
pnpm run build-wasi
pnpm run build-wasm-dev
pnpm run build-npm-dir
pnpm run test-browser
pnpm build-browser-bundle --npmDir npm-dir
test-napi-compiler:
name: Test NAPI Compiler
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
exclude: oxc_linter,oxc_language_server
paths: napi/parser/,napi/minify/,napi/transform/,npm/oxc-types/,npm/runtime/,tasks/e2e/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- uses: ./.github/actions/clone-submodules
if: steps.filter.outputs.changed == 'true'
with:
babel: false
prettier: false
node-compat-table: false
- if: steps.filter.outputs.changed == 'true'
name: Run tests
env:
RUN_RAW_RANGE_TESTS: "true"
RUN_RAW_TOKENS_TESTS: "true"
run: |
pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" build-test
pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" test
- if: steps.filter.outputs.changed == 'true'
name: Run e2e tests
working-directory: tasks/e2e
run: pnpm run test
- if: steps.filter.outputs.changed == 'true'
run: |
git diff --exit-code # Must commit everything
test-napi-oxlint:
name: Test NAPI Oxlint
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
paths: apps/oxlint/,npm/oxlint/,npm/oxlint-plugin-eslint/,npm/oxlint-plugins/,npm/oxc-types/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- if: steps.filter.outputs.changed == 'true'
name: Run tests
run: |
pnpm --filter "./apps/oxlint" build-test
pnpm --filter "./apps/oxlint" test
- if: steps.filter.outputs.changed == 'true'
run: |
git diff --exit-code # Must commit everything
test-napi-oxfmt:
name: Test NAPI Oxfmt
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
paths: apps/oxfmt/,npm/oxfmt/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- if: steps.filter.outputs.changed == 'true'
name: Run tests
run: |
pnpm --filter "./apps/oxfmt" build-test
pnpm --filter "./apps/oxfmt" test
- if: steps.filter.outputs.changed == 'true'
run: |
git diff --exit-code # Must commit everything
test-napi-compiler-windows:
name: Test NAPI Compiler (windows)
runs-on: windows-latest
if: ${{ github.ref_name == 'main' }}
steps:
- run: git config --system core.longpaths true
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
exclude: oxc_linter,oxc_language_server
paths: napi/parser/,napi/minify/,napi/transform/,npm/oxc-types/,npm/runtime/,tasks/e2e/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
if: steps.filter.outputs.changed == 'true'
with:
workspace-copy: true
drive-size: 12GB
drive-format: ReFS
env-mapping: |
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
if: steps.filter.outputs.changed == 'true'
with:
cache-key: napi
save-cache: ${{ github.ref_name == 'main' }}
- uses: ./.github/actions/clone-submodules
if: steps.filter.outputs.changed == 'true'
with:
babel: false
prettier: false
node-compat-table: false
- if: steps.filter.outputs.changed == 'true'
name: Run tests
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
env:
RUN_RAW_RANGE_TESTS: "true"
run: |
pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" build-test
pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" test
- if: steps.filter.outputs.changed == 'true'
name: Run e2e tests
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/tasks/e2e
run: |
pnpm install --frozen-lockfile
pnpm run test
- if: steps.filter.outputs.changed == 'true'
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
run: |
git diff --exit-code # Must commit everything
test-napi-oxlint-windows:
name: Test NAPI Oxlint (windows)
runs-on: windows-latest
if: ${{ github.ref_name == 'main' }}
steps:
- run: git config --system core.longpaths true
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
paths: apps/oxlint/,npm/oxlint/,npm/oxlint-plugin-eslint/,npm/oxlint-plugins/,npm/oxc-types/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
if: steps.filter.outputs.changed == 'true'
with:
workspace-copy: true
drive-size: 12GB
drive-format: ReFS
env-mapping: |
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
if: steps.filter.outputs.changed == 'true'
with:
cache-key: napi
save-cache: ${{ github.ref_name == 'main' }}
- if: steps.filter.outputs.changed == 'true'
name: Run tests
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
run: |
pnpm --filter "./apps/oxlint" build-test
pnpm --filter "./apps/oxlint" test
- if: steps.filter.outputs.changed == 'true'
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
run: |
git diff --exit-code # Must commit everything
test-napi-oxfmt-windows:
name: Test NAPI Oxfmt (windows)
runs-on: windows-latest
if: ${{ github.ref_name == 'main' }}
steps:
- run: git config --system core.longpaths true
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
paths: apps/oxfmt/,npm/oxfmt/,pnpm-lock.yaml,package.json
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
if: steps.filter.outputs.changed == 'true'
with:
workspace-copy: true
drive-size: 12GB
drive-format: ReFS
env-mapping: |
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
if: steps.filter.outputs.changed == 'true'
with:
cache-key: napi
save-cache: ${{ github.ref_name == 'main' }}
- if: steps.filter.outputs.changed == 'true'
name: Run tests
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
run: |
pnpm --filter "./apps/oxfmt" build-test
pnpm --filter "./apps/oxfmt" test
- if: steps.filter.outputs.changed == 'true'
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
run: |
git diff --exit-code # Must commit everything
typos:
name: Spell Check
runs-on: ubuntu-slim
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: crate-ci/typos@02ea592e44b3a53c302f697cddca7641cd051c3d # v1.45.0
with:
files: .
lint:
name: Lint
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- run: rustup component add clippy
- run: cargo lint -- -D warnings
- run: cargo lint --profile dev-no-debug-assertions -- -D warnings
- run: pnpm --filter oxlint-app build-js
- run: pnpm --filter oxfmt-app build-js
- run: node --run lint
doc:
name: Doc
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- run: rustup toolchain install nightly --profile minimal --component rust-docs
# https://github.com/rust-lang/rust/issues/146895
- run: RUSTDOCFLAGS='-D warnings' cargo +nightly doc --no-deps --document-private-items -Zrustdoc-mergeable-info
conformance:
name: Conformance
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- name: Check if conformance should run
id: filter
uses: ./.github/actions/check-changes
with:
packages: oxc_coverage,oxc_transform_conformance,oxc_prettier_conformance
paths: tasks/coverage/,tasks/common/,tasks/oxc_transform_conformance/,tasks/oxc_prettier_conformance/,pnpm-lock.yaml
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: ./.github/actions/clone-submodules
if: steps.filter.outputs.changed == 'true'
with:
node-compat-table: false
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.changed == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1
if: steps.filter.outputs.changed == 'true'
with:
tool: just
- name: Check Conformance
if: steps.filter.outputs.changed == 'true'
run: |
just update-transformer-fixtures
just coverage
git diff --exit-code
minification:
name: Minification Size
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
packages: oxc_minsize
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- name: Check minification size
if: steps.filter.outputs.changed == 'true'
run: |
cargo minsize
git diff --exit-code
allocs:
name: Allocations
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
packages: oxc_track_memory_allocations
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- name: Check allocations
if: steps.filter.outputs.changed == 'true'
run: |
cargo allocs
git diff --exit-code ||
(echo 'Allocations have changed. Run the `cargo allocs` command to update the allocation snapshot, otherwise please fix the regression.' && exit 1)
ast_changes:
name: AST Changes
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: ".github/generated/ast_changes_watch_list.yml"
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
if: steps.filter.outputs.src == 'true'
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
if: steps.filter.outputs.src == 'true'
with:
path: /home/runner/.rustup
cache: |
rust
pnpm
- run: rustup component add rustfmt
if: steps.filter.outputs.src == 'true'
- name: Check AST Changes
if: steps.filter.outputs.src == 'true'
run: |
cargo run -p oxc_ast_tools
git diff --exit-code ||
(echo 'AST changes caused the "generated" code to get outdated. Have you forgotten to run the `just ast` command and/or commit generated codes?' && exit 1)
lintgen:
name: Linter changes
runs-on: namespace-profile-linux-x64-default
steps:
- uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- uses: ./.github/actions/check-changes
id: filter
with:
packages: oxc_linter
paths: tasks/linter_codegen/
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- run: rustup component add rustfmt
if: steps.filter.outputs.changed == 'true'
- name: Check linter changes
if: steps.filter.outputs.changed == 'true'
run: |
cargo lintgen
git diff --exit-code ||
(echo 'Linter codegen has changed. Run the `cargo lintgen` command to update the linter code generated and commit it.' && exit 1)