Build & test WASM #10
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
name: Build & test WASM | |
on: | |
workflow_dispatch: | |
inputs: | |
onnxruntime-version: | |
type: string | |
description: "ONNX Runtime version (e.g. 1.18.0)" | |
required: true | |
emsdk-version: | |
type: string | |
description: "Version of emsdk to use" | |
required: true | |
default: '3.1.51' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install nightly Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install wasm-pack | |
run: cargo install wasm-pack | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.43 | |
- name: Run builder | |
run: | |
deno run -A src/build.ts -v ${{ inputs.onnxruntime-version }} -W -s --xnnpack --emsdk ${{ inputs.emsdk-version }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ortrs-pkort_static-v${{ inputs.onnxruntime-version }}-wasm32-unknown-unknown | |
path: artifact | |
- name: Test ort | |
run: | | |
git clone https://github.com/pykeio/ort && cd ort | |
cd examples/webassembly | |
ORT_LIB_LOCATION=/home/runner/work/ort-artifacts-staging/ort-artifacts-staging/artifact/onnxruntime/lib wasm-pack test --node |