Skip to content

Commit e8df804

Browse files
committed
Implement Testing on CI via wasmtime
1 parent b1d1ad3 commit e8df804

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.wasm32-wasi]
2+
runner = "wasmtime run --wasm-features all --dir ."

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
toolchain: ${{ matrix.rust }}
2424
override: true
25+
target: wasm32-wasi
2526

2627
- name: Build with minimal features (no_std)
2728
run: cargo build --verbose --no-default-features --features libm
@@ -53,3 +54,35 @@ jobs:
5354
env:
5455
RUSTFLAGS: -Ctarget-feature=+avx2
5556
run: cargo test --verbose --all-features
57+
58+
wasm:
59+
runs-on: ubuntu-18.04
60+
strategy:
61+
matrix:
62+
rust:
63+
- nightly
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v2
67+
68+
- name: Install toolchain
69+
uses: actions-rs/toolchain@v1
70+
with:
71+
toolchain: ${{ matrix.rust }}
72+
override: true
73+
74+
- name: Install wasmtime
75+
run: |
76+
curl https://wasmtime.dev/install.sh -sSf | bash
77+
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
78+
79+
- name: Build with minimal features (no_std)
80+
run: cargo build --target wasm32-wasi --verbose --no-default-features --features libm
81+
82+
- name: Run tests without SIMD
83+
run: cargo test --target wasm32-wasi --verbose --no-default-features --features png-format
84+
85+
- name: Run tests with SIMD128
86+
env:
87+
RUSTFLAGS: -Ctarget-feature=+simd128,+bulk-memory,+nontrapping-fptoint,+sign-ext
88+
run: cargo test --target wasm32-wasi --verbose --all-features

0 commit comments

Comments
 (0)