Add Wasi CI.

This commit is contained in:
Stephen Chung 2022-10-12 14:49:05 +08:00
parent a581d51e7a
commit e66b415de2

View File

@ -32,6 +32,7 @@ jobs:
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: check command: check
# typical build with various feature combinations # typical build with various feature combinations
build: build:
name: Build name: Build
@ -86,6 +87,7 @@ jobs:
with: with:
command: test command: test
args: ${{matrix.flags}} args: ${{matrix.flags}}
# no-std builds are a bit more extensive to test # no-std builds are a bit more extensive to test
no_std_build: no_std_build:
name: NoStdBuild name: NoStdBuild
@ -110,32 +112,38 @@ jobs:
with: with:
command: build command: build
args: --manifest-path=no_std/no_std_test/Cargo.toml ${{matrix.flags}} args: --manifest-path=no_std/no_std_test/Cargo.toml ${{matrix.flags}}
wasm: wasm:
name: Check Wasm build name: Check Wasm build
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
flags: flags:
- "--target wasm32-wasi"
# These fail currently, future PR should fix them # These fail currently, future PR should fix them
# - "" # - "--target wasm32-unknown-unknown"
# - "--features wasm-bindgen" # - "--target wasm32-unknown-unknown --features wasm-bindgen"
- "--no-default-features" - "--target wasm32-unknown-unknown --no-default-features"
- "--no-default-features --features wasm-bindgen" - "--target wasm32-unknown-unknown --no-default-features --features wasm-bindgen"
fail-fast: false fail-fast: false
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Toolchain - name: Setup Wasm Toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ env.RUST_MSRV }}
override: true override: true
target: wasm32-unknown-unknown target: wasm32-unknown-unknown
- name: Setup Wasi Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
target: wasm32-wasi
- name: Build - name: Build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: build command: build
args: --target wasm32-unknown-unknown ${{matrix.flags}} args: ${{matrix.flags}}
rustfmt: rustfmt:
name: Check Formatting name: Check Formatting
@ -160,6 +168,7 @@ jobs:
with: with:
command: clippy command: clippy
args: --all -- -Aclippy::all -Dclippy::perf args: --all -- -Aclippy::all -Dclippy::perf
codegen_build: codegen_build:
name: Codegen Build name: Codegen Build
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}