Skip to content

Commit

Permalink
chore: wasm target
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Sep 4, 2024
1 parent 9c29b40 commit cbdbd5e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ jobs:
# - run: cargo +nightly fmt --all -- --check
# - run: cargo +nightly udeps --workspace

build_wasm:
name: Build on WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- run: rustup update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- run: git submodule update --init --recursive
- run: make setup-thirdparty
- run: cargo build --target wasm32-unknown-unknown --workspace --exclude=ffi

build_swift_and_test:
name: Swift Package - latest
runs-on: macos-14
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ eyre = "0.6.12"
thiserror = "1.0"

# Async
tokio = { version = "1.17", features = ["full"] }
tokio = { version = "1.17", features = [] }

# Networking
reqwest = { version = "0.12.5", features = ["json"] }
Expand Down
14 changes: 10 additions & 4 deletions crates/yttrium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ rust-version.workspace = true
[dependencies]
# Ethereum
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "b000e16", features = [
"full",
"contract",
"node-bindings",
"rpc-types-trace",
"signer-mnemonic",
] }
# foundry-block-explorers = "0.2.3"
getrandom = { version = "0.2", features = ["js"] }

# Error/Result
eyre.workspace = true
Expand All @@ -25,19 +26,24 @@ tokio.workspace = true
serde.workspace = true
serde_json.workspace = true

# Networking
reqwest.workspace = true

# Env vars
dotenvy = "0.15.7"

# Other
hex = "0.4.3"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

# Networking
reqwest.workspace = true

[dev-dependencies]
# mocking
wiremock = "0.6.0"

# Networking
reqwest.workspace = true

[build-dependencies]
alloy-primitives = { version = "0.7.0" }
serde_json = "1"
1 change: 1 addition & 0 deletions crates/yttrium/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod account_client;
#[cfg(not(target_arch = "wasm32"))]
pub mod bundler;
pub mod chain;
pub mod config;
Expand Down
6 changes: 6 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ test:

clippy:
cargo clippy --workspace --all-features --all-targets -- -D warnings
cargo clippy --workspace --all-features --all-targets --target wasm32-unknown-unknown --workspace --exclude=ffi -- -D warnings

fmt:
cargo +nightly fmt --all

udeps:
cargo +nightly udeps --workspace

# TODO remove in-favor of just using clippy
build:
cargo build
cargo build --target wasm32-unknown-unknown --workspace --exclude=ffi

0 comments on commit cbdbd5e

Please sign in to comment.