Skip to content

Commit

Permalink
Merge pull request #72 from BP-WG/v0.11
Browse files Browse the repository at this point in the history
Test WASM builds
  • Loading branch information
dr-orlovsky authored Jan 20, 2024
2 parents 04e277b + f41814c commit cbcaf16
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 5 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
77 changes: 73 additions & 4 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 @@ -30,7 +30,7 @@ single_use_seals = "0.11.0-beta.3"
bp-consensus = { version = "0.11.0-beta.3", path = "consensus" }
bp-dbc = { version = "0.11.0-beta.3", path = "./dbc" }
bp-seals = { version = "0.11.0-beta.3", path = "./seals" }
secp256k1 = { version = "0.28.0", features = ["global-context"] }
secp256k1 = { version = ">=0.28.1", features = ["global-context"] }
serde_crate = { package = "serde", version = "1", features = ["derive"] }

[package]
Expand Down 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 cbcaf16

Please sign in to comment.