Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Make sure we run clippy for wasm and fix wasm build/lints #115

Merged
merged 19 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ jobs:
version: "23.3"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run clippy
- name: Install wasm Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: wasm32-unknown-unknown

- name: Run clippy for native
run: cargo clippy --all --all-targets -- -D warnings

- name: Run clippy for wasm32
run: cargo clippy --all --all-targets --target=wasm32-unknown-unknown -- -D warnings


fmt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,6 +78,9 @@ jobs:
- name: Test node crate
run: wasm-pack test --headless --chrome node

- name: Test node-wasm crate
run: wasm-pack test --headless --chrome node-wasm

- name: Build and pack node-wasm
run: wasm-pack build --release --target web node-wasm && wasm-pack pack node-wasm

Expand Down
2 changes: 2 additions & 0 deletions rpc/tests/blob.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]

use std::time::Duration;

use celestia_rpc::prelude::*;
Expand Down
2 changes: 2 additions & 0 deletions rpc/tests/header.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]

use celestia_rpc::prelude::*;

pub mod utils;
Expand Down
2 changes: 1 addition & 1 deletion rpc/tests/p2p.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "p2p")]
#![cfg(all(not(target_arch = "wasm32"), feature = "p2p"))]
use crate::utils::client::{new_test_client, AuthLevel};
use celestia_rpc::prelude::*;
use celestia_types::p2p;
Expand Down
2 changes: 2 additions & 0 deletions rpc/tests/share.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]

use celestia_rpc::prelude::*;
use celestia_types::consts::appconsts::{
CONTINUATION_SPARSE_SHARE_CONTENT_SIZE, FIRST_SPARSE_SHARE_CONTENT_SIZE, SEQUENCE_LEN_BYTES,
Expand Down
2 changes: 2 additions & 0 deletions rpc/tests/state.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]

use celestia_rpc::prelude::*;

pub mod utils;
Expand Down
2 changes: 2 additions & 0 deletions rpc/tests/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]

use celestia_types::nmt::{Namespace, NS_ID_V0_SIZE};
use rand::{Rng, RngCore};

Expand Down
Loading