From 4011d240cb026a5e1f282438ef50aef701721c28 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Mon, 17 Mar 2025 11:16:35 -0700 Subject: add wasm tests to CI --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ test_vectors/Cargo.toml | 1 + 2 files changed, 29 insertions(+) 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 -- cgit v1.2.3