feat: enable use of preexisting weval binary #435
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
defaults: | |
run: | |
shell: bash | |
# Cancel any in-flight jobs for the same PR/branch so there's only one active | |
# at a time | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
- name: Install Rust | |
run: | | |
rustup update stable | |
rustup default stable | |
rustup component add rustfmt | |
- name: Format source code | |
run: cargo fmt -- --check | |
######### | |
# Build # | |
######### | |
build-splicer: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- '20' | |
- latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
- name: Install Rust Toolchain | |
run: | | |
rustup toolchain install 1.77.1 | |
rustup target add wasm32-wasi --toolchain 1.77.1 | |
rustup target add wasm32-wasi | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Cache Splicer build | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: splicer-build | |
with: | |
key: splicer-build-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
path: | | |
lib/spidermonkey-embedding-splicer.core2.wasm | |
lib/spidermonkey-embedding-splicer.core.wasm | |
lib/spidermonkey-embedding-splicer.d.ts | |
lib/spidermonkey-embedding-splicer.js | |
target | |
- name: Build splicer | |
if: steps.splicer-build.outputs.cache-hit != 'true' | |
run: | | |
make lib/spidermonkey-embedding-splicer.js | |
build-jit: | |
runs-on: ubuntu-latest | |
needs: | |
- build-splicer | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- '20' | |
- latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
with: | |
submodules: recursive | |
- name: Install Rust Toolchain | |
run: | | |
rustup toolchain install 1.77.1 | |
rustup target add wasm32-wasi --toolchain 1.77.1 | |
rustup target add wasm32-wasi | |
- name: Restore Embedding Splicer from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: splicer-build | |
with: | |
key: splicer-build-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
lib/starlingmonkey_embedding_weval.wasm | |
lib/starlingmonkey_ics.wevalcache | |
target | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- name: Cache StarlingMonkey | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-build-jit | |
with: | |
key: starlingmonkey-build-jit-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
lookup-only: 'true' | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
build-release | |
- name: Build ComponentizeJS | |
if: steps.starlingmonkey-build-jit.outputs.cache-hit != 'true' | |
run: npm run build | |
build-aot: | |
runs-on: ubuntu-latest | |
needs: | |
- build-splicer | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- '20' | |
- latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
with: | |
submodules: recursive | |
- name: Install Rust Toolchain | |
run: | | |
rustup toolchain install 1.77.1 | |
rustup target add wasm32-wasi --toolchain 1.77.1 | |
rustup target add wasm32-wasi | |
- name: Restore Embedding Splicer from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: splicer-build | |
with: | |
key: splicer-build-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
path: | | |
lib/spidermonkey-embedding-splicer.core2.wasm | |
lib/spidermonkey-embedding-splicer.core.wasm | |
lib/spidermonkey-embedding-splicer.d.ts | |
lib/spidermonkey-embedding-splicer.js | |
target | |
- name: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- name: Cache StarlingMonkey (Weval) | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-build-aot | |
with: | |
key: engine-build-aot-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
lookup-only: 'true' | |
path: | | |
lib/starlingmonkey_embedding_weval.wasm | |
lib/starlingmonkey_ics.wevalcache | |
build-release-weval | |
- name: Build Weval | |
if: steps.starlingmonkey-build-aot.outputs.cache-hit != 'true' | |
run: make release-weval | |
######## | |
# Test # | |
######## | |
test-jit: | |
runs-on: ubuntu-latest | |
needs: | |
- build-jit | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- '20' | |
- latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
- name: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- name: Restore Embedding Splicer from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: splicer-build | |
with: | |
key: splicer-build-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
path: | | |
lib/spidermonkey-embedding-splicer.core2.wasm | |
lib/spidermonkey-embedding-splicer.core.wasm | |
lib/spidermonkey-embedding-splicer.d.ts | |
lib/spidermonkey-embedding-splicer.js | |
target | |
- name: Restore StarlingMonkey from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-build-jit | |
with: | |
key: starlingmonkey-build-jit-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
target | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Test | |
run: npm run test | |
- name: Cache Example build | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
with: | |
path: example/target | |
key: example-jit-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }} | |
- name: Test Example | |
run: cd example && npm run build && ./test.sh | |
test-aot: | |
runs-on: ubuntu-latest | |
needs: | |
- build-aot | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- '20' | |
- latest | |
env: | |
ENABLE_AOT: "1" | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
- name: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- name: Restore Embedding Splicer from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: splicer-build | |
with: | |
key: splicer-build-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} | |
path: | | |
lib/spidermonkey-embedding-splicer.core2.wasm | |
lib/spidermonkey-embedding-splicer.core.wasm | |
lib/spidermonkey-embedding-splicer.d.ts | |
lib/spidermonkey-embedding-splicer.js | |
target | |
- name: Restore StarlingMonkey (Weval) from cache | |
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-build-aot | |
with: | |
key: starlingmonkey-build-aot-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
path: | | |
lib/starlingmonkey_embedding_weval.wasm | |
lib/starlingmonkey_ics.wevalcache | |
target | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Test | |
run: npm run test:weval | |
- name: Cache Example build | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
with: | |
path: example/target | |
key: example-aot-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }} | |
- name: Test Example | |
run: cd example && npm run build && ./test.sh |