-
Notifications
You must be signed in to change notification settings - Fork 129
792 lines (661 loc) · 25.6 KB
/
Copy pathmain.yml
File metadata and controls
792 lines (661 loc) · 25.6 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
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
name: test
on:
merge_group:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "latest"
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Install Rust
run: rustup update stable --no-self-update
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: jco-${{ hashFiles('Cargo.lock') }}
- name: Enable sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Setup sccache
run: |
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Install node modules
run: pnpm install
- name: Build jco for test
working-directory: packages/jco
run: |
pnpm --filter '@bytecodealliance/jco' run build
pnpm --filter '@bytecodealliance/jco' run build:test:components
- name: Upload jco build output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build
path: packages/jco/obj
- name: Upload artifacts for js tests
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: js-generated-tests
path: packages/jco-transpile/test/fixtures/generated
- name: Build jco-transpile
run: pnpm --filter '@bytecodealliance/jco-transpile' run build
- name: Upload jco-transpile vendor
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: jco-transpile-vendor
path: |
packages/jco-transpile/vendor
- name: Build preview2-shim
run: pnpm --filter '@bytecodealliance/preview2-shim' run build
- name: Upload preview2-shim build output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-preview2-shim
path: packages/preview2-shim/dist
test-jco:
runs-on: ${{ matrix.os }}
needs:
- build
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
node:
- 22.x
- 24.x
- latest # 26.x
include:
- os: ubuntu-latest
weval-bin-path: .weval-bin/weval
- os: macos-latest
weval-bin-path: .weval-bin/weval
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wasm-tools@1.244.0
# Determine weval version
- name: Determine weval version
id: weval-meta
run: |
WEVAL_LATEST_URL="$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/bytecodealliance/weval/releases/latest)";
export WEVAL_LATEST_URL;
export WEVAL_VERSION=${WEVAL_LATEST_URL#https://github.com/bytecodealliance/weval/releases/tag/}
echo -e "version=$WEVAL_VERSION" >> "$GITHUB_OUTPUT"
# Use cached weval bin if present
- name: Cache weval bin
id: cache-weval-bin
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .weval-bin
key: weval-bin-${{ steps.weval-meta.outputs.version }}-${{ matrix.os }}
# (no cached weval bin) download weval release
- if: ${{ steps.cache-weval-bin.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') }}
env:
WEVAL_VERSION: ${{ steps.weval-meta.outputs.version }}
run: |
curl -LO "https://github.com/bytecodealliance/weval/releases/download/$WEVAL_VERSION/weval-$WEVAL_VERSION-x86_64-linux.tar.xz"
tar -xvJf "weval-$WEVAL_VERSION-x86_64-linux.tar.xz"
mv "weval-$WEVAL_VERSION-x86_64-linux/weval" .weval-bin
- if: ${{ steps.cache-weval-bin.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
env:
WEVAL_VERSION: ${{ steps.weval-meta.outputs.version }}
run: |
curl -LO "https://github.com/bytecodealliance/weval/releases/download/$WEVAL_VERSION/weval-$WEVAL_VERSION-aarch64-macos.tar.xz"
tar -xvJf "weval-$WEVAL_VERSION-aarch64-macos.tar.xz"
mkdir .weval-bin
mv "weval-$WEVAL_VERSION-aarch64-macos/weval" .weval-bin/
- name: Install NPM packages
run: pnpm install
- name: Restore jco build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: packages/jco/obj
- name: Restore preview2-shim build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-preview2-shim
path: packages/preview2-shim/dist
- name: Test jco (node@lts)
if: matrix.node != 'latest'
working-directory: packages/jco
run: |
pnpm --filter '@bytecodealliance/jco' run test:lts -- --maxWorkers 4 --minWorkers 2 --maxConcurrency 2
- name: Test jco (node@latest)
if: matrix.node == 'latest'
working-directory: packages/jco
env:
WEVAL_BIN_PATH: ${{ matrix.weval-bin-path }}
run: |
pnpm --filter '@bytecodealliance/jco' run test -- --maxWorkers 4 --minWorkers 2 --maxConcurrency 2
test-jco-transpile:
runs-on: ${{ matrix.os }}
needs:
- build
strategy:
matrix:
os:
- ubuntu-22.04 # https://github.com/puppeteer/puppeteer/issues/12818#issuecomment-2593659514
- macos-latest
node:
- 22.x
- 24.x
- latest # 26.x
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wasm-tools@1.244.0
- name: Install NPM packages
run: pnpm install
- name: Cache puppeteer install
if: ${{ startsWith(matrix.os, 'ubuntu') }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: puppeteer-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
/home/runner/.cache/puppeteer
- name: Cache puppeteer install
if: ${{ startsWith(matrix.os, 'macos') }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: puppeteer-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
/Users/runner/.cache/puppeteer
# NOTE: We can stop pinning the version of puppeteer when the version that the mac atttempts to use
# syncs up (right now newest is 148.0.7778.178, but puppeteer will attempt to use 148.0.7778.97)
- name: Install puppeteer (pinned)
if: ${{ matrix.node == 'latest' }}
run: |
export PUPPETEER_VERSION=148.0.7778.97
pnpm run test:setup:puppeteer
- name: Install puppeteer
if: ${{ matrix.node != 'latest' }}
run: |
pnpm run test:setup:puppeteer
- name: Restore jco-transpile build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: jco-transpile-vendor
path: packages/jco-transpile/vendor
- name: Restore artifacts for JS tests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: js-generated-tests
path: packages/jco-transpile/test/fixtures/generated
- name: Restore preview2-shim build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-preview2-shim
path: packages/preview2-shim/dist
- name: Test jco-transpile (node@lts)
if: matrix.node != 'latest'
working-directory: packages/jco-transpile
run: |
pnpm --filter '@bytecodealliance/jco-transpile' run test:lts -- --maxWorkers 4 --minWorkers 2 --maxConcurrency 2
- name: Test jco-transpile (node@latest)
if: matrix.node == 'latest'
working-directory: packages/jco-transpile
run: |
pnpm --filter '@bytecodealliance/jco-transpile' run test -- --maxWorkers 4 --minWorkers 2 --maxConcurrency 2
test-wasi-deno:
runs-on: "ubuntu-latest"
needs:
- build
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
submodules: recursive
- name: Install Rust deps
run: |
rustup update stable --no-self-update && rustup default stable
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasip1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "latest"
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
with:
deno-version: v1.x
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Install node modules
run: pnpm install
- name: Restore jco build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: packages/jco/obj
- name: Restore artifacts for JS tests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: js-generated-tests
path: packages/jco-transpile/test/fixtures/generated
- name: Restore preview2-shim build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-preview2-shim
path: packages/preview2-shim/dist
- name: Generate tests
run: |
cargo xtask generate tests preview2
- name: WASI Preview 2 Conformance
run: cargo test deno_
test-wasi-node:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
node:
- 22.x
- 24.x
- latest
fail-fast: false
runs-on: ${{ matrix.os }}
needs:
- build
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
submodules: recursive
- name: Install Rust deps
run: |
rustup update stable --no-self-update && rustup default stable
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasip1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Restore jco build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: packages/jco/obj
- name: Restore artifacts for JS tests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: js-generated-tests
path: packages/jco-transpile/test/fixtures/generated
- name: Restore preview2-shim build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-preview2-shim
path: packages/preview2-shim/dist
- name: Install node modules
run: pnpm install
- name: Generate tests
run: |
cargo xtask generate tests preview2
- name: WASI Preview 2 Conformance
run: |
cargo test node_
test-shims:
runs-on: ubuntu-latest
strategy:
matrix:
workspace:
- preview2-shim
- preview3-shim
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust
run: rustup update stable --no-self-update
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: jco-${{ hashFiles('Cargo.lock') }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Install node modules
run: pnpm install
- name: Cache puppeteer install
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: puppeteer-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
/home/runner/.cache/puppeteer
- name: Install puppeteer
run: |
pnpm run test:setup:puppeteer
- name: Build jco
run: pnpm run build
- name: Test Workspaces
env:
TEST_PUPPETEER_LAUNCH_ARGS: |
--no-sandbox
run: pnpm --filter 'packages/${{ matrix.workspace }}' run test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Install node modules
run: pnpm install
- name: Lint
run: pnpm run lint
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- name: Install node modules
run: pnpm install
- name: Format
run: pnpm run fmt:check
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: Remove tests mod
run: rm -r crates/jco/tests/mod.rs
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Format source code
run: cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Remove tests mod
run: rm -r crates/jco/tests/mod.rs
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Run clippy
run: cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings
test-jco-std:
runs-on: ubuntu-latest
strategy:
matrix:
workspace:
- jco-std
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust
run: rustup update stable --no-self-update
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: jco-${{ hashFiles('Cargo.lock') }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wasmtime-cli@40.0.2
- name: Install node modules
working-directory: packages/${{ matrix.workspace }}
run: |
pnpm install
- name: Build jco-transpile, jco-std
run: |
pnpm --filter "packages/jco-transpile" run build
pnpm --filter "packages/${{ matrix.workspace }}" run build
- name: run test on workspace
run: |
pnpm --filter "packages/${{ matrix.workspace }}" run test
examples:
needs:
- build
runs-on: ubuntu-latest
strategy:
matrix:
wac:
- version: 0.6.0
node:
- version: 24.x
project:
- name: add
workspace: examples/components/add
- name: adder
workspace: examples/components/adder
- name: string-reverse
workspace: examples/components/string-reverse
- name: string-reverse-upper
workspace: examples/components/string-reverse-upper
is-composed: true
- name: webidl-book-library
workspace: examples/components/webidl-book-library
uses-webidl2wit: true
- name: node-fetch
workspace: examples/components/node-fetch
- name: http-hello-world
workspace: examples/components/http-hello-world
- name: http-server-fetch-handler
workspace: examples/components/http-server-fetch-handler
- name: http-server-hono
workspace: examples/components/http-server-hono
setup-transpile: true
setup-std: true
- name: host-logging
workspace: examples/components/host-logging
- name: ts-resource-import
workspace: examples/components/ts-resource-import
- name: ts-resource-export
workspace: examples/components/ts-resource-export
- name: typegen-async-export
workspace: examples/components/typegen-async-export
- name: node-compat
workspace: examples/components/node-compat
- name: fs-write-file
workspace: examples/components/fs-write-file
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node.version }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- name: Restore jco build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: packages/jco/obj
- name: Restore artifacts for JS tests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: js-generated-tests
path: packages/jco-transpile/test/fixtures/generated
- name: Restore jco-transpile vendor
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: jco-transpile-vendor
path: |
packages/jco-transpile/vendor
- name: Install Rust
if: ${{ matrix.project.uses-webidl2wit }}
run: rustup update stable --no-self-update && rustup default stable
- name: install webidl2wit-cli
if: ${{ matrix.project.uses-webidl2wit }}
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: webidl2wit-cli
- name: Install wac
if: ${{ matrix.project.is-composed }}
uses: jaxxstorm/action-install-gh-release@25e24d2d23ae098373794ef1d6faecb48ee52da8 # v3.0.0
with:
repo: bytecodealliance/wac
tag: v${{ matrix.wac.version }}
extension-matching: disable
rename-to: wac
chmod: 0755
- uses: bytecodealliance/actions/wasmtime/setup@9152e710e9f7182e4c29ad218e4f335a7b203613 # v1.1.3
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
node_modules
- run: pnpm install
- name: Build required deps
env:
SETUP_TRANSPILE: ${{ matrix.project.setup-transpile }}
SETUP_STD: ${{ matrix.project.setup-std }}
run: |
if [ "true" == "$SETUP_TRANSPILE" ]; then
pnpm run --filter '@bytecodealliance/jco-transpile' build
fi
if [ "true" == "$SETUP_STD" ]; then
pnpm run --filter '@bytecodealliance/jco-std' build
fi
- name: Run all script for (${{ matrix.project.name }})
run: |
pnpm --filter '${{ matrix.project.workspace }}' run all
test-extended:
runs-on: ${{ matrix.os }}
needs:
- build
permissions:
contents: read
strategy:
matrix:
os:
- ubuntu-latest
node:
- latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wasm-tools
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wit-bindgen-cli
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wac-cli
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: just
- uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: wkg
- id: wasi-sdk
uses: bytecodealliance/setup-wasi-sdk-action@b2de090b44eb70013ee96b393727d473b35e1728
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: pnpm install
- name: Restore jco build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: packages/jco/obj
- name: Build extended component tree
working-directory: test/components
env:
WASI_SDK: ${{ steps.wasi-sdk.outputs.wasi-sdk-path }}
run: just build
- name: Run extended component tests
run: |
pnpm --filter '@bytecodealliance/jco' run test:extended