Skip to content

Commit c77092e

Browse files
authored
fix(ci): run build on wasm32 target (#26)
1 parent 8f0f8ba commit c77092e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.wasm32-unknown-unknown]
2+
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
check:
2-
cargo check
2+
cargo check --quiet --no-default-features
3+
cargo check --quiet --all-features
4+
cargo check --quiet --no-default-features --target wasm32-unknown-unknown
5+
cargo check --quiet --all-features --target wasm32-unknown-unknown
36

47
test:
5-
cargo test
8+
cargo test --all-features
69

710
doc:
811
cargo doc
@@ -32,9 +35,8 @@ fmt:
3235
corepack enable && yarn && yarn md-fmt
3336

3437
clippy:
35-
cargo clippy --all-targets --quiet --no-deps -- --deny=warnings
36-
cargo clippy --all-targets --no-default-features --quiet --no-deps -- --deny=warnings
3738
cargo clippy --all-targets --all-features --quiet --no-deps -- --deny=warnings
39+
cargo clippy --all-features --target wasm32-unknown-unknown --quiet --no-deps -- --deny=warnings
3840

3941
# Checks if all headers are present and adds if not
4042
license:

gpbft/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ thiserror = { workspace = true }
2525
[dev-dependencies]
2626
filecoin-f3-gpbft = { features = ["test-utils"], path = "../gpbft" }
2727

28+
[target.'cfg(target_family="wasm")'.dependencies]
29+
getrandom = { version = "0.3", features = ["wasm_js"] }
30+
2831
[features]
2932
test-utils = []

rust-toolchain.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[toolchain]
22
channel = "1.85.0"
33
components = ["clippy", "llvm-tools-preview", "rustfmt"]
4+
targets = ["wasm32-unknown-unknown"]

0 commit comments

Comments
 (0)