Skip to content

Commit

Permalink
Enable avail-light-core wasm compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
aterentic-ethernal committed Nov 25, 2024
1 parent df7d0c4 commit 6d471bf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ jobs:
files: lcov.info
- name: Cleanup
run: find . -name \*.profraw -type f -exec rm -f {} +

wasm:
name: wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown
- run: cargo build --package avail-light-core --target wasm32-unknown-unknown

4 changes: 3 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ edition = "2021"
description = "Avail Light core driving library"

[dependencies]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Internal deps
avail-rust = { workspace = true }
dusk-plonk = { workspace = true }
Expand Down Expand Up @@ -63,7 +65,7 @@ opentelemetry_sdk = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
tracing-subscriber = { workspace = true }

[dev-dependencies]
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
hex-literal = "0.4.0"
proptest = "1.0.0"
test-case = "3.2.1"
Expand Down
17 changes: 17 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
#[cfg(not(target_arch = "wasm32"))]
pub mod api;
#[cfg(not(target_arch = "wasm32"))]
pub mod app_client;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "crawl")]
#[cfg(not(target_arch = "wasm32"))]
pub mod crawl_client;
#[cfg(not(target_arch = "wasm32"))]
pub mod data;
#[cfg(not(target_arch = "wasm32"))]
pub mod fat_client;
#[cfg(not(target_arch = "wasm32"))]
pub mod finality;
#[cfg(not(target_arch = "wasm32"))]
pub mod light_client;
#[cfg(not(target_arch = "wasm32"))]
pub mod maintenance;
#[cfg(not(target_arch = "wasm32"))]
pub mod network;
#[cfg(not(target_arch = "wasm32"))]
pub mod proof;
#[cfg(not(target_arch = "wasm32"))]
pub mod shutdown;
#[cfg(not(target_arch = "wasm32"))]
pub mod sync_client;
#[cfg(not(target_arch = "wasm32"))]
pub mod sync_finality;
#[cfg(not(target_arch = "wasm32"))]
pub mod telemetry;
#[cfg(not(target_arch = "wasm32"))]
pub mod types;
#[cfg(not(target_arch = "wasm32"))]
pub mod utils;

0 comments on commit 6d471bf

Please sign in to comment.