Skip to content

Commit

Permalink
Run wasm32 tests in CI (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
james7132 committed Mar 22, 2024
1 parent 2937449 commit 8e9aed1
Show file tree
Hide file tree
Showing 6 changed files with 1,298 additions and 1,230 deletions.
1 change: 1 addition & 0 deletions .github/Cargo.toml.wasm_ci
@@ -0,0 +1 @@
wasm-bindgen-test = "0.3"
16 changes: 10 additions & 6 deletions .github/workflows/rust.yml
Expand Up @@ -120,14 +120,18 @@ jobs:
build-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
features: ["+simd128", "-simd128"]
env:
RUSTFLAGS: "-C target-feature=${{matrix.features}} -D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown
- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: cat .github/Cargo.toml.wasm_ci >> Cargo.toml
- run: wasm-pack test --headless --chrome
- run: wasm-pack test --headless --firefox

miri:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/block/mod.rs
Expand Up @@ -60,7 +60,7 @@ pub use self::avx2::*;

#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
mod wasm;
#[cfg(all(target_arch = "wasm", target_feature = "simd128"))]
#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
pub use self::wasm::*;

impl Block {
Expand Down
3 changes: 0 additions & 3 deletions src/block/wasm.rs
@@ -1,8 +1,5 @@
use core::{
arch::wasm32::*,
cmp::Ordering,
hash::{Hash, Hasher},
iter::Iterator,
ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not},
};

Expand Down

0 comments on commit 8e9aed1

Please sign in to comment.