aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2025-03-17 11:16:35 -0700
committerJack O'Connor <[email protected]>2025-03-18 10:00:16 -0700
commit4011d240cb026a5e1f282438ef50aef701721c28 (patch)
treecb751b50f12df4a2b4fca7a74388767ab0b036f4
parent4ca3c6fb7fdecc4978c5075f89be3be8c0f38266 (diff)
add wasm tests to CI
-rw-r--r--.github/workflows/ci.yml28
-rw-r--r--test_vectors/Cargo.toml1
2 files changed, 29 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0ed8325..7c8b257 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -222,6 +222,34 @@ jobs:
- run: ./c/blake3_c_rust_bindings/cross_test.sh --target ${{ matrix.arch }} --features=neon
if: startsWith(matrix.arch, 'armv7-') || startsWith(matrix.arch, 'aarch64-')
+ wasm_tests:
+ name: WASM tests
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: wasm32-wasip1
+ - name: install Wasmtime
+ run: |
+ curl https://wasmtime.dev/install.sh -sSf | bash
+ echo PATH: $PATH
+ mkdir -p ~/.local/bin
+ ln -s ~/.wasmtime/bin/wasmtime ~/.local/bin/wasmtime
+ - run: cargo test --target wasm32-wasip1
+ - run: cargo test --target wasm32-wasip1 --no-default-features
+ - run: cargo test --target wasm32-wasip1 --features wasm32_simd
+ - run: cargo test --target wasm32-wasip1 --no-default-features --features wasm32_simd
+ - run: cargo test --target wasm32-wasip1 --benches --features=wasm32_simd
+ env:
+ RUSTC_BOOTSTRAP: 1
+ - name: test vectors w/o SIMD
+ run: cargo test --target wasm32-wasip1
+ working-directory: ./test_vectors
+ - name: test vectors w/ SIMD
+ run: cargo test --target wasm32-wasip1 --features wasm32_simd
+ working-directory: ./test_vectors
+
cargo_xwin_test:
name: cargo xwin test
runs-on: ubuntu-latest
diff --git a/test_vectors/Cargo.toml b/test_vectors/Cargo.toml
index 87a9eba..46ba58c 100644
--- a/test_vectors/Cargo.toml
+++ b/test_vectors/Cargo.toml
@@ -7,6 +7,7 @@ edition = "2021"
neon = ["blake3/neon"]
prefer_intrinsics = ["blake3/prefer_intrinsics"]
pure = ["blake3/pure"]
+wasm32_simd = ["blake3/wasm32_simd"]
[dependencies]
# If you ever change these path dependencies, you'll probably need to update