From 0fd85820a362a1a8f0987a7631461ad4cc6283c0 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Wed, 2 Oct 2024 21:05:16 +0200 Subject: [PATCH 1/5] build workflow --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b56969f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +on: + push: + branches: + - master + paths-ignore: + - "**.md" + - "!.github/workflows/*.yml" + + pull_request: + paths-ignore: + - "**.md" + - "!.github/workflows/*.yml" + +name: Tests + +jobs: + build: + strategy: + matrix: + platform: [ ubuntu-latest, macos-latest ] + runs-on: ${{ matrix.platform }} + timeout-minutes: 60 + + name: build - ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v2 + - run: cargo build From 29b8da5dbebd57156e3fa8accfdb5c19abbe15bf Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Wed, 2 Oct 2024 21:05:57 +0200 Subject: [PATCH 2/5] ci workflow --- .github/workflows/ci.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b56969f..5544078 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,34 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: nightly override: true - uses: Swatinem/rust-cache@v2 - run: cargo build + + lint: + strategy: + matrix: + platform: [ ubuntu-latest ] + runs-on: ${{ matrix.platform }} + timeout-minutes: 60 + + name: lint - ${{ matrix.crate }} - ${{ matrix.platform }} + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - name: cargo fmt + if: success() || failure() + run: cargo fmt -- --check + - name: cargo clippy + if: success() || failure() + run: | + cargo clippy --release -- -D warnings From 1ad1789e8efef256462f0b0c9592cb48bb2fadab Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Wed, 2 Oct 2024 21:07:18 +0200 Subject: [PATCH 3/5] naming --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5544078..8046e27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - "**.md" - "!.github/workflows/*.yml" -name: Tests +name: General jobs: build: From 97a9c5a3ace3b93805ebf4e6cae6e067cb6f611a Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Wed, 2 Oct 2024 21:22:05 +0200 Subject: [PATCH 4/5] allow empty_loop --- node_runner/src/lib.rs | 1 + sequencer_runner/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/node_runner/src/lib.rs b/node_runner/src/lib.rs index d8a957c..4c5e698 100644 --- a/node_runner/src/lib.rs +++ b/node_runner/src/lib.rs @@ -11,6 +11,7 @@ pub async fn main_runner() -> Result<()> { let _http_server_handle = http_server.handle(); tokio::spawn(http_server); + #[allow(clippy::empty_loop)] loop { //ToDo: Insert activity into main loop } diff --git a/sequencer_runner/src/lib.rs b/sequencer_runner/src/lib.rs index 181b8cf..1c9ed3c 100644 --- a/sequencer_runner/src/lib.rs +++ b/sequencer_runner/src/lib.rs @@ -11,6 +11,7 @@ pub async fn main_runner() -> Result<()> { let _http_server_handle = http_server.handle(); tokio::spawn(http_server); + #[allow(clippy::empty_loop)] loop { //ToDo: Insert activity into main loop } From fe44b4829facbdb3670f34d2d376c1d38a7b3d52 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Wed, 2 Oct 2024 21:38:13 +0200 Subject: [PATCH 5/5] #[allow(clippy::too_long_first_doc_paragraph)] --- rpc_primitives/src/errors.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc_primitives/src/errors.rs b/rpc_primitives/src/errors.rs index f718baf..6bbf207 100644 --- a/rpc_primitives/src/errors.rs +++ b/rpc_primitives/src/errors.rs @@ -4,6 +4,7 @@ use std::fmt; #[derive(serde::Serialize)] pub struct RpcParseError(pub String); +#[allow(clippy::too_long_first_doc_paragraph)] /// This struct may be returned from JSON RPC server in case of error /// It is expected that that this struct has impls From<_> all other RPC errors /// like [`RpcBlockError`](crate::types::blocks::RpcBlockError)