Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Install system deps, Rust toolchain, WASI SDK, wasmtime, and config

inputs:
target:
description: Build target — "native" or "wasm32-wasip2"
description: 'Build target: "native", "wasm32-wasip2" or "wasm32-wasip3"'
required: true

runs:
Expand Down Expand Up @@ -33,8 +33,17 @@ runs:
shell: bash
run: rustup target add wasm32-wasip2

# The pinned toolchain ships no wasm32-wasip3 std, so the justfile builds that target with
# `cargo +nightly`. The pinned toolchain is still needed for the host-side test harnesses.
- name: Install nightly Rust toolchain with the wasm32-wasip3 target
if: inputs.target == 'wasm32-wasip3'
shell: bash
run: |
rustup toolchain install nightly --profile minimal --target wasm32-wasip3
rustc +nightly --version

- name: Install WASI SDK
if: inputs.target == 'wasm32-wasip2'
if: inputs.target != 'native'
shell: bash
run: |
sudo mkdir -p /opt/wasi-sdk
Expand All @@ -43,7 +52,7 @@ runs:
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> "$GITHUB_ENV"

- name: Install wasmtime
if: inputs.target == 'wasm32-wasip2'
if: inputs.target != 'native'
shell: bash
run: |
curl -sSf https://wasmtime.dev/install.sh | bash
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,35 @@ concurrency:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
WASI_SDK_VERSION: "33"
WASI_SDK_VERSION: "34"
RUSTC_WRAPPER: sccache
CCACHE: sccache
# Bump to purge the sccache GHA cache.
SCCACHE_GHA_VERSION: 1

jobs:
# ---------------------------------------------------------------------------
# Cargo tests: {native, wasm32-wasip2} × {debug+debugmozjs, release}
# Cargo tests: {native, wasm32-wasip2, wasm32-wasip3} × {debug+debugmozjs, release}
# The wasm recipes also run the serve end-to-end suite (`just test-serve-wasm`).
# ---------------------------------------------------------------------------
test:
name: Test (${{ matrix.target }}, ${{ matrix.profile }})
strategy:
fail-fast: false
matrix:
target: [native, wasm32-wasip2]
target: [native, wasm32-wasip2, wasm32-wasip3]
profile: [debug, release]
include:
- { target: native, profile: debug, recipe: test }
- { target: native, profile: release, recipe: test-release }
- { target: wasm32-wasip2, profile: debug, recipe: test-wasm }
- { target: wasm32-wasip2, profile: release, recipe: test-wasm-release }
- { target: wasm32-wasip3, profile: debug, recipe: test-wasm }
- { target: wasm32-wasip3, profile: release, recipe: test-wasm-release }
runs-on: ubuntu-latest
env:
# Only the wasm recipes read this.
WASM_TARGET: ${{ matrix.target }}
WASMTIME_BACKTRACE_DETAILS: '1'
RUST_BACKTRACE: 'full'
steps:
Expand All @@ -57,20 +61,21 @@ jobs:
run: just ${{ matrix.recipe }}

- name: Run example tests
if: matrix.target == 'wasm32-wasip2'
if: matrix.target != 'native'
run: just ${{ matrix.recipe }} --examples

# ---------------------------------------------------------------------------
# WPT suite: {native, wasm32-wasip2}
# WPT suite: {native, wasm32-wasip2, wasm32-wasip3}
# ---------------------------------------------------------------------------
wpt:
name: WPT (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
target: [native, wasm32-wasip2]
target: [native, wasm32-wasip2, wasm32-wasip3]
runs-on: ubuntu-latest
env:
WASM_TARGET: ${{ matrix.target }}
WASMTIME_BACKTRACE_DETAILS: '1'
RUST_BACKTRACE: 'full'
steps:
Expand All @@ -93,7 +98,7 @@ jobs:
# The recipes build the runtime before running the harness.
- name: Run WPT tests
run: |
if [[ "${{ matrix.target }}" == "wasm32-wasip2" ]]; then
if [[ "${{ matrix.target }}" != "native" ]]; then
just wpt-test-wasm -v
else
just wpt-test -v
Expand Down
77 changes: 35 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ starling-macro = { path = "crates/starling-macro" }
tokio = { version = "1", features = ["rt", "time", "net", "io-util"] }
url = "2.5.8"
uuid = { version = "1.23", features = ["v4"] }
wasip3 = { version = "0.8.0", features = ["http-compat"] }
wit-bindgen = { version = "=0.61.0", features = ["macros"] }
wasip3 = { version = "0.9.0", features = ["http-compat"] }
# Must equal the `wit-bindgen` version `wasip3` depends on. See `starling/Cargo.toml`.
wit-bindgen = { version = "=0.62.0", features = ["macros"] }
wpt-support = { path = "crates/wpt-support" }

# bindgen = { version = "0.72", default-features = false, features = [
Expand Down
Loading
Loading