Skip to content

Commit

Permalink
ci: test crates on wasmtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 30, 2024
1 parent 732f4e2 commit a7510f8
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ jobs:
cargo test
cargo ck
test-wasm:
name: Test Wasm
runs-on: ubuntu-latest
env:
RUSTFLAGS: "--cfg tokio_unstable -C target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128 -C link-args=--max-memory=67108864"
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --dir=${{ github.workspace }}::${{ github.workspace }} --"
# Insta is not able to run on wasmtime, omit the packages that depend on it
TEST_FLAGS: "-p oxc_sourcemap -p oxc_ast -p oxc_cfg -p oxc_index -p oxc_js_regex -p oxc_module_lexer -- --nocapture"
steps:
- uses: taiki-e/checkout-action@v1
- uses: Boshen/setup-rust@main
with:
# warm cache factory for all other CI jobs
# cache `target` directory to avoid download crates
save-cache: ${{ github.ref_name == 'main' }}
cache-key: warm
- name: Add Rust Target
run: rustup target add wasm32-wasip1-threads
- name: Install wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
- run: cargo test --target wasm32-wasip1-threads ${{ env.TEST_FLAGS }}
- run: git diff --exit-code # Must commit everything
wasm:
name: Check Wasm
runs-on: ubuntu-latest
Expand All @@ -101,20 +123,7 @@ jobs:
with:
cache-key: wasm
save-cache: ${{ github.ref_name == 'main' }}
- name: Check
run: |
rustup target add wasm32-unknown-unknown
cargo check -p oxc_wasm --target wasm32-unknown-unknown
- name: Build
run: |
npx -y wasm-pack build --target web --dev ./crates/oxc_wasm
npx -y wasm-pack build --target web --dev ./wasm/parser
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Check output types
run: npx -y -p typescript tsc --lib es2020,dom crates/oxc_wasm/pkg/oxc_wasm.d.ts


typos:
name: Spell Check
Expand Down

0 comments on commit a7510f8

Please sign in to comment.