Skip to content

Commit

Permalink
ci: add WASM tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jan 19, 2024
1 parent 5a4139c commit f41814c
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ jobs:
with:
command: test
args: --workspace --all-features --no-fail-fast
wasm-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v2
- uses: jetli/[email protected]
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Test in headless Chrome
run: wasm-pack test --headless --chrome
69 changes: 69 additions & 0 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,13 @@ serde = [
]
stl = ["strict_types", "strict_types/base64", "bp-consensus/stl", "commit_verify/stl"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
rand = { version = "0.8.4", optional = true }
getrandom = { version = "0.2", features = ["js"] }

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

[package.metadata.docs.rs]
features = [ "all" ]

0 comments on commit f41814c

Please sign in to comment.