feat: enable use of preexisting weval binary #450
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: artifact-splicer-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: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- 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: artifact-splicer-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 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Cache StarlingMonkey | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-jit | |
with: | |
key: artifact-starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
lookup-only: 'true' | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
build-release | |
- name: Build ComponentizeJS | |
if: steps.starlingmonkey-jit.outputs.cache-hit != 'true' | |
run: | | |
make release | |
make lib/starlingmonkey_embedding.wasm | |
- uses: actions/upload-artifact@v4 | |
if: steps.starlingmonkey-jit.outputs.cache-hit != 'true' | |
with: | |
name: build-starlingmonkey-jit | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
build-release | |
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: Get StarlingMonkey Commit | |
id: starlingmonkey-commit | |
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" | |
- 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: artifact-splicer-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 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install NPM packages | |
run: npm install | |
- name: Cache StarlingMonkey (Weval) | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 | |
id: starlingmonkey-aot | |
with: | |
key: artifact-starlingmonkey-aot-node-${{matrix.node-version}}-${{ 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-aot.outputs.cache-hit != 'true' | |
run: | | |
make release-weval | |
make lib/starlingmonkey_embedding_weval.wasm | |
make lib/starlingmonkey_ics.wevalcache | |
- uses: actions/upload-artifact@v4 | |
if: steps.starlingmonkey-aot.outputs.cache-hit != 'true' | |
with: | |
name: build-starlingmonkey-aot | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
build-release | |
######## | |
# 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: artifact-splicer-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-jit | |
with: | |
key: artifact-starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
path: | | |
lib/starlingmonkey_embedding.wasm | |
target | |
- uses: actions/download-artifact@v4 | |
if: steps.starlingmonkey-jit.outputs.cache-hit != 'true' | |
with: | |
name: build-starlingmonkey-jit | |
- 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: artifact-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: artifact-splicer-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-aot | |
with: | |
key: artifact-starlingmonkey-aot-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} | |
path: | | |
lib/starlingmonkey_embedding_weval.wasm | |
lib/starlingmonkey_ics.wevalcache | |
target | |
- uses: actions/download-artifact@v4 | |
if: steps.starlingmonkey-aot.outputs.cache-hit != 'true' | |
with: | |
name: build-starlingmonkey-aot | |
- 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: artifact-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 |