Skip to content

Commit

Permalink
ensure all elements are under CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Apr 2, 2024
1 parent 04109e4 commit 50f3d40
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ jobs:
cache-on-failure: true

- name: Build
run: cargo build --all-targets --all-features --verbose
run: cargo build --all-targets --all-features --workspace --verbose

- name: Build `no-std`
run: cargo build --no-default-features --all-targets --verbose
run: cargo build --no-default-features --all-targets --workspace --verbose

- name: Run tests
run: cargo test --all-features --all-targets --verbose
run: |
cargo test --all-features --all-targets --workspace --verbose
cargo test --doc
lint:
runs-on: ubuntu-latest
Expand All @@ -59,7 +61,7 @@ jobs:
run: cargo +nightly fmt --all --check

- name: Check clippy
run: cargo +nightly clippy --all-targets --all-features --verbose -- -D warnings
run: cargo +nightly clippy --all-targets --all-features --workspace --verbose -- -D warnings

coverage:
runs-on: ubuntu-latest
Expand Down
9 changes: 5 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
test:
cargo test --all-features --all-targets
cargo test --all-features --workspace --all-targets
cargo test --doc
fmt:
cargo +nightly fmt --all
lint: fmt
cargo +nightly clippy --all-targets --all-features
cargo +nightly clippy --all-features --workspace --all-targets
build:
cargo build --all-targets --all-features
cargo build --all-features --workspace --all-targets
build-no-std:
cargo build --no-default-features --all-targets
cargo build --no-default-features --workspace --all-targets
run-ci: lint build build-no-std test
2 changes: 1 addition & 1 deletion ssz-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ mod exports {
where
T: crate::Serializable,
{
let mut result = vec![];
let mut result = crate::lib::Vec::new();
value.serialize(&mut result)?;
Ok(result)
}
Expand Down
2 changes: 2 additions & 0 deletions ssz-rs/src/merkleization/merkleize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
ser::Serialize,
GeneralizedIndex,
};
#[cfg(feature = "serde")]
use alloy_primitives::hex::FromHex;
use sha2::{Digest, Sha256};

Expand Down Expand Up @@ -251,6 +252,7 @@ impl Tree {
Ok(())
}

#[cfg(feature = "serde")]
fn nodes(&self) -> impl Iterator<Item = Node> + '_ {
self.0.chunks(BYTES_PER_CHUNK).map(|chunk| Node::from_hex(chunk).unwrap())
}
Expand Down

0 comments on commit 50f3d40

Please sign in to comment.