Skip to content

feat: support the debugBuild option for debugging Wasm stacks #553

feat: support the debugBuild option for debugging Wasm stacks

feat: support the debugBuild option for debugging Wasm stacks #553

Workflow file for this run

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@v4
- 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
steps:
- uses: actions/checkout@v4
- name: Cache Splicer build
uses: actions/cache@v4
id: splicer-build
with:
key: splicer-${{ 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
- name: Install Rust Toolchain
if: steps.splicer-build.outputs.cache-hit != 'true'
run: |
rustup toolchain install 1.77.1
rustup target add wasm32-wasi --toolchain 1.77.1
rustup target add wasm32-wasip1
- uses: actions/setup-node@v4
if: steps.splicer-build.outputs.cache-hit != 'true'
with:
node-version: '22'
- name: Install NPM packages
if: steps.splicer-build.outputs.cache-hit != 'true'
run: npm install
- name: Build splicer
if: steps.splicer-build.outputs.cache-hit != 'true'
run: make lib/spidermonkey-embedding-splicer.js
build:
runs-on: ubuntu-latest
needs:
- build-splicer
strategy:
fail-fast: false
matrix:
build-type:
- 'release'
- 'debug'
- 'weval'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get StarlingMonkey Commit
id: starlingmonkey-commit
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: starlingmonkey-build
with:
key: starlingmonkey-${{matrix.build-type}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }}
path: lib
- name: Install Rust Toolchain
if: steps.starlingmonkey-build.outputs.cache-hit != 'true'
run: |
rustup toolchain install 1.77.1
rustup target add wasm32-wasi --toolchain 1.77.1
rustup target add wasm32-wasip1
- name: Install wasm-tools
if: steps.starlingmonkey-build.outputs.cache-hit != 'true'
run: cargo install wasm-tools
- name: Restore Embedding Splicer from cache
uses: actions/cache/restore@v4
id: splicer-build
with:
key: splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
path: lib
- uses: actions/setup-node@v4
if: steps.starlingmonkey-build.outputs.cache-hit != 'true'
with:
node-version: '22'
- name: Install NPM packages
if: steps.starlingmonkey-build.outputs.cache-hit != 'true'
run: npm install
- name: Build ComponentizeJS
if: steps.starlingmonkey-build.outputs.cache-hit != 'true'
run: |
npm run clean
npm run build:${{matrix.build-type}}
########
# Test #
########
test:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
node-version:
- '22.14.0'
# - latest reenable when https://github.com/nodejs/node/issues/57172 is fixed
build-type:
- 'release'
- 'debug'
- 'weval'
steps:
- uses: actions/checkout@v4
- name: Get StarlingMonkey Commit
id: starlingmonkey-commit
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT"
- name: Restore StarlingMonkey build from cache
uses: actions/cache/restore@v4
id: restore-starlingmonkey-jit-build
with:
key: starlingmonkey-${{matrix.build-type}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }}
path: lib
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version}}
- name: Install NPM packages
run: npm install
- name: Test
run: npm run test:${{matrix.build-type}}
- name: Cache Example build
uses: actions/cache@v4
with:
path: example/target
key: example-jit-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }}
test-example:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Get StarlingMonkey Commit
id: starlingmonkey-commit
run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT"
- name: Restore StarlingMonkey build from cache
uses: actions/cache/restore@v4
id: restore-starlingmonkey-jit-build
with:
key: starlingmonkey-release-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }}
path: lib
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install NPM packages
run: npm install
- name: Cache Example build
uses: actions/cache@v4
with:
path: example/target
key: example-jit-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }}