Skip to content

Merge pull request #16 from rivet-dev/ralph/wasmvm-dynamic-modules #93

Merge pull request #16 from rivet-dev/ralph/wasmvm-dynamic-modules

Merge pull request #16 from rivet-dev/ralph/wasmvm-dynamic-modules #93

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
typecheck-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# --- Rust / WASM build ---
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2026-03-01
targets: wasm32-wasip1
components: rust-src
- name: Install wasm-opt (binaryen)
run: sudo apt-get update && sudo apt-get install -y binaryen
- name: Cache WASM build artifacts
uses: actions/cache@v4
with:
path: |
wasmvm/target
wasmvm/vendor
key: wasm-${{ runner.os }}-${{ hashFiles('wasmvm/Cargo.lock', 'wasmvm/rust-toolchain.toml') }}
- name: Build WASM binary
run: cd wasmvm && make wasm
# --- C toolchain (wasi-sdk + patched sysroot + C test fixtures) ---
- name: Cache wasi-sdk
id: cache-wasi-sdk
uses: actions/cache@v4
with:
path: wasmvm/c/vendor/wasi-sdk
key: wasi-sdk-25-${{ runner.os }}-${{ runner.arch }}
- name: Download wasi-sdk
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
run: make -C wasmvm/c wasi-sdk
- name: Cache patched wasi-libc sysroot
id: cache-sysroot
uses: actions/cache@v4
with:
path: |
wasmvm/c/sysroot
wasmvm/c/vendor/wasi-libc
key: wasi-libc-sysroot-${{ runner.os }}-${{ hashFiles('wasmvm/patches/wasi-libc/*.patch', 'wasmvm/scripts/patch-wasi-libc.sh') }}
- name: Build patched wasi-libc sysroot
if: steps.cache-sysroot.outputs.cache-hit != 'true'
run: make -C wasmvm/c sysroot
- name: Build C test fixtures (WASM + native)
run: make -C wasmvm/c programs native
# --- Node.js / TypeScript ---
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.6
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm check-types
- name: Run tests
run: pnpm test