From 2096b91e5c0d1bc0c51ded2ffc54f73485c1ed21 Mon Sep 17 00:00:00 2001 From: "hawkinsjgh@gmail.com" Date: Sun, 16 Jun 2024 17:34:07 +0100 Subject: [PATCH 1/5] base --- .github/scripts/check_no_std.sh | 25 +++++++++++++++++++++++++ .github/workflows/integration.yml | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 .github/scripts/check_no_std.sh diff --git a/.github/scripts/check_no_std.sh b/.github/scripts/check_no_std.sh new file mode 100755 index 000000000000..f2e6f1f1077e --- /dev/null +++ b/.github/scripts/check_no_std.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -eo pipefail + +# List of no_std packages +no_std_packages=( + reth-db + reth-network-peers +) + +# Loop through each package and check it for no_std compliance +for package in "${no_std_packages[@]}"; do + cmd="cargo +stable check -p $package --target riscv32imac-unknown-none-elf --no-default-features" + + if [ -n "$CI" ]; then + echo "::group::$cmd" + else + printf "\n%s:\n %s\n" "$package" "$cmd" + fi + + $cmd + + if [ -n "$CI" ]; then + echo "::endgroup::" + fi +done diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 319896154b19..1d71412b390e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -78,6 +78,21 @@ jobs: -- db get static-file headers 100000 \ | grep 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 + no-std: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: riscv32imac-unknown-none-elf + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Run no_std checks + run: ./scripts/check_no_std.sh + integration-success: name: integration success runs-on: ubuntu-latest From 13b48d4d17eaddf8c5a98f7be666f171b2f01b25 Mon Sep 17 00:00:00 2001 From: "hawkinsjgh@gmail.com" Date: Sun, 16 Jun 2024 18:34:37 +0100 Subject: [PATCH 2/5] bump --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1d71412b390e..2b09ba9fffea 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -91,7 +91,7 @@ jobs: with: cache-on-failure: true - name: Run no_std checks - run: ./scripts/check_no_std.sh + run: .github/scripts/check_no_std.sh integration-success: name: integration success From ebab18e276e886a3f9a0bf55867b49cff594f639 Mon Sep 17 00:00:00 2001 From: "hawkinsjgh@gmail.com" Date: Sun, 16 Jun 2024 20:56:58 +0100 Subject: [PATCH 3/5] move to lint --- .github/workflows/integration.yml | 15 --------------- .github/workflows/lint.yml | 27 ++++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2b09ba9fffea..319896154b19 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -78,21 +78,6 @@ jobs: -- db get static-file headers 100000 \ | grep 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 - no-std: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - target: riscv32imac-unknown-none-elf - - uses: taiki-e/install-action@cargo-hack - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: Run no_std checks - run: .github/scripts/check_no_std.sh - integration-success: name: integration success runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ffcb7f239a57..d2b9c9dcbef3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -149,10 +149,35 @@ jobs: name: lint success runs-on: ubuntu-latest if: always() - needs: [clippy-binaries, clippy, crate-checks, docs, fmt, book, codespell, grafana] + needs: + [ + clippy-binaries, + clippy, + crate-checks, + docs, + fmt, + book, + codespell, + grafana, + ] timeout-minutes: 30 steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} + + no-std: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: riscv32imac-unknown-none-elf + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Run no_std checks + run: .github/scripts/check_no_std.sh From c927362f06e260b519b6bf3c1affda11a96550f6 Mon Sep 17 00:00:00 2001 From: "hawkinsjgh@gmail.com" Date: Mon, 17 Jun 2024 22:29:15 +0100 Subject: [PATCH 4/5] correct formatting --- .github/workflows/lint.yml | 48 ++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d2b9c9dcbef3..c07cee38830b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,6 +45,21 @@ jobs: env: RUSTFLAGS: -D warnings + no-std: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: riscv32imac-unknown-none-elf + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Run no_std checks + run: .github/scripts/check_no_std.sh + crate-checks: runs-on: ubuntu-latest timeout-minutes: 30 @@ -150,34 +165,17 @@ jobs: runs-on: ubuntu-latest if: always() needs: - [ - clippy-binaries, - clippy, - crate-checks, - docs, - fmt, - book, - codespell, - grafana, - ] + - clippy-binaries + - clippy + - crate-checks + - docs + - fmt + - book + - codespell + - grafana timeout-minutes: 30 steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} - - no-std: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - target: riscv32imac-unknown-none-elf - - uses: taiki-e/install-action@cargo-hack - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: Run no_std checks - run: .github/scripts/check_no_std.sh From 1ebff6ae4185e1b1a8b46878c0a1fdd5deb6e165 Mon Sep 17 00:00:00 2001 From: "hawkinsjgh@gmail.com" Date: Mon, 17 Jun 2024 22:34:22 +0100 Subject: [PATCH 5/5] update script --- .github/scripts/check_no_std.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_no_std.sh b/.github/scripts/check_no_std.sh index f2e6f1f1077e..8d64ad172b3b 100755 --- a/.github/scripts/check_no_std.sh +++ b/.github/scripts/check_no_std.sh @@ -9,7 +9,7 @@ no_std_packages=( # Loop through each package and check it for no_std compliance for package in "${no_std_packages[@]}"; do - cmd="cargo +stable check -p $package --target riscv32imac-unknown-none-elf --no-default-features" + cmd="cargo +stable check -p $package --no-default-features" if [ -n "$CI" ]; then echo "::group::$cmd"