Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,27 @@ jobs:
- name: build
run: cargo +nightly fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=30 || exit 255"

wasm_tests:
name: WASM tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.92.0
with:
targets: wasm32-unknown-unknown
- name: Install wasm-bindgen-cli
shell: bash
run: |
WASM_BINDGEN_VERSION=$(cargo tree -p wasm-bindgen --depth 0 --target wasm32-unknown-unknown 2>/dev/null | head -1 | sed 's/.*v//')
cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION"
- name: cargo test (default)
run: cargo test -p clvmr --target wasm32-unknown-unknown --release
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner

unit_tests:
name: Unit tests
runs-on: ${{ matrix.os }}
Expand Down
51 changes: 51 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,17 @@ thiserror = "1.0.69"

[dev-dependencies]
rstest = { workspace = true }
criterion = { workspace = true }
hex = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { workspace = true, features = ["js"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"

[[bench]]
name = "run-program"
harness = false
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[toolchain]
channel = "1.92.0"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
Loading
Loading