-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(test/wasi): enable tests in multiple platforms (#894)
- Loading branch information
Showing
3 changed files
with
83 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: WASI Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
changed: | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
run: | ||
name: WASI Test | ||
if: ${{ inputs.changed }} | ||
runs-on: ${{ inputs.os }} | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true # Pull submodules for additional files | ||
|
||
- name: Install Rust | ||
uses: moonrepo/setup-rust@v1 | ||
with: | ||
bins: just | ||
cache-base: main | ||
targets: wasm32-wasi-preview1-threads | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
|
||
- name: Pnpm install | ||
# Node.js wasi runtime has bug with `std::fs::read_link` | ||
run: | | ||
touch .npmrc | ||
echo "node-linker=hoisted" >> .npmrc | ||
pnpm install | ||
- name: Build WASI Rolldown | ||
run: just build wasi release | ||
|
||
- name: Build Basic Example | ||
run: pnpm --filter=@example/basic build | ||
if: ${{ inputs.os == 'ubuntu-latest' }} | ||
env: | ||
NAPI_RS_FORCE_WASI: 1 | ||
RUST_LOG: trace | ||
|
||
- name: Node Test | ||
run: pnpm run --recursive --filter=!rollup-tests test | ||
if: false | ||
env: | ||
NAPI_RS_FORCE_WASI: 1 | ||
RUST_LOG: trace | ||
|
||
- name: Rollup Test | ||
run: pnpm run --filter rollup-tests test | ||
if: false | ||
env: | ||
NAPI_RS_FORCE_WASI: 1 | ||
RUST_LOG: trace |