Skip to content

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

feat: support the debugBuild option for debugging Wasm stacks

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

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: Install Rust Toolchain
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
with:
node-version: '22'
- name: Install NPM packages
run: npm install
- 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: 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"
- name: Install Rust Toolchain
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
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
with:
node-version: '22'
- name: Install NPM packages
run: npm install
- name: Build ComponentizeJS
run: |
npm run clean
npm run build:${{matrix.build-type}}
- uses: actions/cache/save@v4
with:
key: starlingmonkey-${{matrix.build-type}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }}
path: lib
########
# Test #
########
test:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
node-version:
- '22'
# - 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 }}

Check failure on line 150 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 150, Col: 16): Unrecognized named-value: 'matrix-build-type'. Located at position 1 within expression: matrix-build-type

Check failure on line 150 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 150, Col: 16): Unrecognized named-value: 'matrix-build-type'. Located at position 1 within expression: matrix-build-type
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') }}
- name: Test Example
working-directory: examples/hello-world
run: bash test.sh
test-aot:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
node-version:
- '22'
- latest
env:
ENABLE_AOT: "1"
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 AOT build from cache
uses: actions/cache/restore@v4
id: restore-starlingmonkey-aot-build
with:
key: starlingmonkey-aot-node-${{matrix.node-version}}-${{ 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:weval
- name: Cache Example build
uses: actions/cache@v4
with:
path: example/target
key: example-aot-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }}
- name: Test Example
working-directory: examples/hello-world
run: bash test.sh