@@ -324,7 +324,7 @@ jobs:
324
324
test-npm-package :
325
325
if : github.ref != 'refs/heads/main'
326
326
runs-on : ubuntu-latest
327
- needs : [build]
327
+ needs : [build, starlingmonkey-build ]
328
328
strategy :
329
329
matrix :
330
330
node-version : [18, 20]
@@ -338,6 +338,10 @@ jobs:
338
338
uses : actions/download-artifact@v3
339
339
with :
340
340
name : engine-release
341
+ - name : Download Engine
342
+ uses : actions/download-artifact@v3
343
+ with :
344
+ name : starling-release
341
345
- run : yarn
342
346
shell : bash
343
347
- run : npm test
@@ -356,3 +360,127 @@ jobs:
356
360
fastly-api-token : ${{ secrets.FASTLY_API_TOKEN }}
357
361
fastly-cli-version : ${{ env.fastly-cli_version }}
358
362
github-token : ${{ secrets.GITHUB_TOKEN }}
363
+
364
+ starlingmonkey-build :
365
+ name : StarlingMonkey Build
366
+ runs-on : ubuntu-latest
367
+ steps :
368
+ - uses : actions/checkout@v3
369
+ with :
370
+ submodules : true
371
+ - name : Install Rust 1.77.1
372
+ run : |
373
+ rustup toolchain install 1.77.1
374
+ rustup target add wasm32-wasi --toolchain 1.77.1
375
+ - name : Build
376
+ run : npm run build:starlingmonkey
377
+ - uses : actions/upload-artifact@v3
378
+ with :
379
+ name : starling-release
380
+ path : starling.wasm
381
+
382
+ starlingmonkey-run_wpt :
383
+ if : github.ref != 'refs/heads/main'
384
+ name : Run Web Platform Tests
385
+ needs : [starlingmonkey-build, ensure_cargo_installs]
386
+ runs-on : ubuntu-latest
387
+ steps :
388
+ - uses : actions/checkout@v3
389
+ with :
390
+ submodules : true
391
+ - uses : actions/setup-node@v3
392
+ with :
393
+ node-version : 20
394
+ cache : ' yarn'
395
+
396
+ - name : Download Engine
397
+ uses : actions/download-artifact@v3
398
+ with :
399
+ name : starling-release
400
+
401
+ - name : Restore Viceroy from cache
402
+ uses : actions/cache@v3
403
+ with :
404
+ path : " /home/runner/.cargo/bin/viceroy"
405
+ key : crate-cache-viceroy-${{ env.viceroy_version }}
406
+
407
+ - name : Restore wasm-tools from cache
408
+ uses : actions/cache@v3
409
+ id : wasm-tools
410
+ with :
411
+ path : " /home/runner/.cargo/bin/wasm-tools"
412
+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
413
+
414
+ - name : " Check wasm-tools has been restored"
415
+ if : steps.wasm-tools.outputs.cache-hit != 'true'
416
+ run : |
417
+ echo "wasm-tools was not restored from the cache"
418
+ echo "bailing out from the build early"
419
+ exit 1
420
+
421
+ - run : yarn install --frozen-lockfile
422
+
423
+ - name : Build WPT runtime
424
+ run : tests/wpt-harness/build-wpt-runtime.sh --starlingmonkey
425
+
426
+ - name : Prepare WPT hosts
427
+ run : |
428
+ cd tests/wpt-harness/wpt
429
+ ./wpt make-hosts-file | sudo tee -a /etc/hosts
430
+
431
+ - name : Run tests
432
+ timeout-minutes : 20
433
+ run : node ./tests/wpt-harness/run-wpt.mjs --starlingmonkey -vv
434
+
435
+ starlingmonkey-sdktest :
436
+ if : github.ref != 'refs/heads/main'
437
+ runs-on : ubuntu-latest
438
+ strategy :
439
+ matrix :
440
+ platform : [viceroy, compute]
441
+ needs : [starlingmonkey-build]
442
+ steps :
443
+ - name : Checkout fastly/js-compute-runtime
444
+ uses : actions/checkout@v3
445
+ - uses : actions/setup-node@v3
446
+ with :
447
+ node-version : ' lts/*'
448
+ cache : ' yarn'
449
+
450
+ - name : Set up Fastly CLI
451
+ uses : fastly/compute-actions/setup@v4
452
+ with :
453
+ token : ${{ secrets.GITHUB_TOKEN }}
454
+ cli_version : ${{ env.fastly-cli_version }}
455
+
456
+ - name : Restore Viceroy from cache
457
+ if : ${{ matrix.platform == 'viceroy' }}
458
+ uses : actions/cache@v3
459
+ id : viceroy
460
+ with :
461
+ path : " /home/runner/.cargo/bin/viceroy"
462
+ key : crate-cache-viceroy-${{ env.viceroy_version }}
463
+
464
+ - name : Restore wasm-tools from cache
465
+ uses : actions/cache@v3
466
+ id : wasm-tools
467
+ with :
468
+ path : " /home/runner/.cargo/bin/wasm-tools"
469
+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
470
+
471
+ - name : " Check caches have been restored"
472
+ if : steps.wasm-tools.outputs.cache-hit != 'true' || matrix.platform == 'viceory' && steps.viceroy.outputs.cache-hit != 'true'
473
+ run : echo "Unable to restore from the cache, bailing." && exit 1
474
+
475
+ - name : Download Engine
476
+ uses : actions/download-artifact@v3
477
+ with :
478
+ name : starling-release
479
+ - run : yarn install --frozen-lockfile
480
+
481
+ - name : Yarn install
482
+ run : yarn && cd ./integration-tests/js-compute && yarn
483
+
484
+ - run : node integration-tests/js-compute/test.js --starlingmonkey ${{ matrix.platform == 'viceroy' && '--local' || '' }}
485
+ env :
486
+ FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
0 commit comments