Skip to content

Commit 8e9aed1

Browse files
authored
Run wasm32 tests in CI (#119)
1 parent 2937449 commit 8e9aed1

6 files changed

Lines changed: 1298 additions & 1230 deletions

File tree

.github/Cargo.toml.wasm_ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wasm-bindgen-test = "0.3"

.github/workflows/rust.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,18 @@ jobs:
120120
121121
build-wasm:
122122
runs-on: ubuntu-latest
123-
timeout-minutes: 30
123+
strategy:
124+
matrix:
125+
features: ["+simd128", "-simd128"]
126+
env:
127+
RUSTFLAGS: "-C target-feature=${{matrix.features}} -D warnings"
124128
steps:
125129
- uses: actions/checkout@v4
126-
- uses: dtolnay/rust-toolchain@stable
127-
with:
128-
target: wasm32-unknown-unknown
129-
- name: Check wasm
130-
run: cargo check --target wasm32-unknown-unknown
130+
- name: Install
131+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
132+
- run: cat .github/Cargo.toml.wasm_ci >> Cargo.toml
133+
- run: wasm-pack test --headless --chrome
134+
- run: wasm-pack test --headless --firefox
131135

132136
miri:
133137
runs-on: ubuntu-latest

src/block/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub use self::avx2::*;
6060

6161
#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
6262
mod wasm;
63-
#[cfg(all(target_arch = "wasm", target_feature = "simd128"))]
63+
#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
6464
pub use self::wasm::*;
6565

6666
impl Block {

src/block/wasm.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use core::{
22
arch::wasm32::*,
3-
cmp::Ordering,
4-
hash::{Hash, Hasher},
5-
iter::Iterator,
63
ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not},
74
};
85

0 commit comments

Comments
 (0)