diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml new file mode 100644 index 00000000..88f32856 --- /dev/null +++ b/.github/workflows/rust-ci.yml @@ -0,0 +1,40 @@ +name: Rust CI + +on: + push: + branches: [main] + merge_group: + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + cargo-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@just + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - uses: taiki-e/install-action@nextest + - name: tests + run: just test + + cargo-lint: + runs-on: ubuntu-latest + timeout-minutes: 20 + name: lint + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@just + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: fmt + lint + run: just fmt diff --git a/world-chain-builder/crates/toolkit/src/cli.rs b/world-chain-builder/crates/toolkit/src/cli.rs index e053449a..09bbae08 100644 --- a/world-chain-builder/crates/toolkit/src/cli.rs +++ b/world-chain-builder/crates/toolkit/src/cli.rs @@ -1,4 +1,4 @@ -use bytes::{Bytes, BytesMut}; +use bytes::Bytes; use chrono::NaiveDate; use clap::Parser; use identity_source::IdentitySource; diff --git a/world-chain-builder/src/e2e_tests/mod.rs b/world-chain-builder/src/e2e_tests/mod.rs index b0917507..4bb2a4f0 100644 --- a/world-chain-builder/src/e2e_tests/mod.rs +++ b/world-chain-builder/src/e2e_tests/mod.rs @@ -1,10 +1,12 @@ //! Utilities for running world chain builder end-to-end tests. use crate::{ + date_marker::DateMarker, + external_nullifier::ExternalNullifier, node::{ args::{ExtArgs, WorldChainBuilderArgs}, builder::{WorldChainAddOns, WorldChainBuilder}, }, - pbh::semaphore::{DateMarker, ExternalNullifier, Proof, SemaphoreProof}, + pbh::semaphore::{Proof, SemaphoreProof}, pool::{ ordering::WorldChainOrdering, root::{LATEST_ROOT_SLOT, OP_WORLD_ID}, diff --git a/world-chain-builder/src/external_nullifier.rs b/world-chain-builder/src/external_nullifier.rs index ea956829..5a95b187 100644 --- a/world-chain-builder/src/external_nullifier.rs +++ b/world-chain-builder/src/external_nullifier.rs @@ -85,7 +85,6 @@ impl FromStr for ExternalNullifier { #[cfg(test)] mod tests { - use semaphore::hash_to_field; use test_case::test_case; use super::*; diff --git a/world-chain-builder/src/pool/validator.rs b/world-chain-builder/src/pool/validator.rs index d1d9e260..bdae7407 100644 --- a/world-chain-builder/src/pool/validator.rs +++ b/world-chain-builder/src/pool/validator.rs @@ -293,7 +293,6 @@ pub mod tests { use tempfile::tempdir; use test_case::test_case; - use super::*; use crate::date_marker::DateMarker; use crate::external_nullifier::ExternalNullifier; use crate::pbh::db::load_world_chain_db;