From 082fc5a9e51c1a662a1531acdb420fb2f79dc0f7 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 13:04:56 +0100 Subject: [PATCH 1/8] chore(ci): enable more crates in check_no_std --- .github/assets/check_no_std.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/assets/check_no_std.sh b/.github/assets/check_no_std.sh index 441ef5d0d48d..864a2eea950f 100755 --- a/.github/assets/check_no_std.sh +++ b/.github/assets/check_no_std.sh @@ -4,12 +4,12 @@ set -eo pipefail # TODO no_std_packages=( # The following were confirmed not working in the past, but could be enabled if issues have been resolved -# reth-db -# reth-primitives -# reth-revm -# reth-evm -# reth-evm-ethereum -# reth-consensus + reth-db + reth-primitives + reth-revm + reth-evm + reth-evm-ethereum + reth-consensus # the following are confirmed working reth-errors reth-ethereum-forks From c0c1392355f0b523bee846e2d58d29144878d61e Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 13:10:16 +0100 Subject: [PATCH 2/8] do not crash on non-0 exit code --- .github/assets/check_no_std.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/assets/check_no_std.sh b/.github/assets/check_no_std.sh index 864a2eea950f..3389ab9e4d17 100755 --- a/.github/assets/check_no_std.sh +++ b/.github/assets/check_no_std.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -eo pipefail +set +e # TODO no_std_packages=( From e051eebdaaf24423f5e253d06aac1604573d251e Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 13:12:38 +0100 Subject: [PATCH 3/8] print results --- .github/assets/check_no_std.sh | 48 +++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/assets/check_no_std.sh b/.github/assets/check_no_std.sh index 3389ab9e4d17..a3764846217a 100755 --- a/.github/assets/check_no_std.sh +++ b/.github/assets/check_no_std.sh @@ -1,23 +1,26 @@ #!/usr/bin/env bash -set +e +set +e # Disable immediate exit on error -# TODO +# Array of crates no_std_packages=( -# The following were confirmed not working in the past, but could be enabled if issues have been resolved - reth-db - reth-primitives - reth-revm - reth-evm - reth-evm-ethereum - reth-consensus -# the following are confirmed working - reth-errors - reth-ethereum-forks - reth-network-peers - reth-primitives-traits - reth-codecs + # The following were confirmed not working in the past, but could be enabled if issues have been resolved + reth-db + reth-primitives + reth-revm + reth-evm + reth-evm-ethereum + reth-consensus + # The following are confirmed working + reth-errors + reth-ethereum-forks + reth-network-peers + reth-primitives-traits + reth-codecs ) +# Dictionary to hold the results +declare -A results + for package in "${no_std_packages[@]}"; do cmd="cargo +stable build -p $package --target wasm32-wasip1 --no-default-features" @@ -27,9 +30,24 @@ for package in "${no_std_packages[@]}"; do printf "\n%s:\n %s\n" "$package" "$cmd" fi + # Run the command and capture the return code $cmd + ret_code=$? + + # Store the result in the dictionary + if [ $ret_code -eq 0 ]; then + results["$package"]="Success" + else + results["$package"]="Failed" + fi if [ -n "$CI" ]; then echo "::endgroup::" fi done + +# Print summary +echo -e "\nSummary of build results:" +for package in "${!results[@]}"; do + echo "$package: ${results[$package]}" +done From bacd07b2a2f467664b183aa8b7631cf28ce4a892 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 13:16:12 +0100 Subject: [PATCH 4/8] exit with non-zero if any fails --- .github/assets/check_no_std.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/assets/check_no_std.sh b/.github/assets/check_no_std.sh index a3764846217a..08e15bb748b1 100755 --- a/.github/assets/check_no_std.sh +++ b/.github/assets/check_no_std.sh @@ -20,6 +20,8 @@ no_std_packages=( # Dictionary to hold the results declare -A results +# Flag to track if any command fails +any_failed=0 for package in "${no_std_packages[@]}"; do cmd="cargo +stable build -p $package --target wasm32-wasip1 --no-default-features" @@ -36,9 +38,10 @@ for package in "${no_std_packages[@]}"; do # Store the result in the dictionary if [ $ret_code -eq 0 ]; then - results["$package"]="Success" + results["$package"]="✅" else - results["$package"]="Failed" + results["$package"]="❌" + any_failed=1 fi if [ -n "$CI" ]; then @@ -51,3 +54,6 @@ echo -e "\nSummary of build results:" for package in "${!results[@]}"; do echo "$package: ${results[$package]}" done + +# Exit with a non-zero status if any command fails +exit $any_failed From 9c88556b8b4607606e8962711dbdeb654a09bae1 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 13:18:20 +0100 Subject: [PATCH 5/8] rename to wasm checks --- .github/assets/{check_no_std.sh => check_wasm.sh} | 0 .github/workflows/lint.yml | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/assets/{check_no_std.sh => check_wasm.sh} (100%) diff --git a/.github/assets/check_no_std.sh b/.github/assets/check_wasm.sh similarity index 100% rename from .github/assets/check_no_std.sh rename to .github/assets/check_wasm.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b108ddb96b48..0a36d5fc084e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,7 +45,7 @@ jobs: env: RUSTFLAGS: -D warnings - no-std: + wasm: runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -57,8 +57,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - name: Run no_std checks - run: .github/assets/check_no_std.sh + - name: Run Wasm checks + run: .github/assets/check_wasm.sh crate-checks: runs-on: ubuntu-latest From 353a595ea911a299462d6633d25bd157d48a556d Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 15:54:04 +0100 Subject: [PATCH 6/8] rename sh var --- .github/assets/check_wasm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index 08e15bb748b1..410e99047d2f 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -2,7 +2,7 @@ set +e # Disable immediate exit on error # Array of crates -no_std_packages=( +wasm_packages=( # The following were confirmed not working in the past, but could be enabled if issues have been resolved reth-db reth-primitives @@ -23,7 +23,7 @@ declare -A results # Flag to track if any command fails any_failed=0 -for package in "${no_std_packages[@]}"; do +for package in "${wasm_packages[@]}"; do cmd="cargo +stable build -p $package --target wasm32-wasip1 --no-default-features" if [ -n "$CI" ]; then From 761d13be2b49ff12c602a997ff45d9c2554c750f Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 18:07:59 +0100 Subject: [PATCH 7/8] comment not working crates for now --- .github/assets/check_wasm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index 410e99047d2f..6e161528b08f 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -4,12 +4,12 @@ set +e # Disable immediate exit on error # Array of crates wasm_packages=( # The following were confirmed not working in the past, but could be enabled if issues have been resolved - reth-db - reth-primitives - reth-revm - reth-evm - reth-evm-ethereum - reth-consensus + # reth-db + # reth-primitives + # reth-revm + # reth-evm + # reth-evm-ethereum + # reth-consensus # The following are confirmed working reth-errors reth-ethereum-forks From 07cd595ab0201cfebfc55be5de8e93d4109e5904 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 1 Aug 2024 18:20:30 +0100 Subject: [PATCH 8/8] sort --- .github/assets/check_wasm.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index 6e161528b08f..f9832324c3b7 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -2,7 +2,7 @@ set +e # Disable immediate exit on error # Array of crates -wasm_packages=( +wasm_crates=( # The following were confirmed not working in the past, but could be enabled if issues have been resolved # reth-db # reth-primitives @@ -18,18 +18,18 @@ wasm_packages=( reth-codecs ) -# Dictionary to hold the results -declare -A results +# Array to hold the results +results=() # Flag to track if any command fails any_failed=0 -for package in "${wasm_packages[@]}"; do - cmd="cargo +stable build -p $package --target wasm32-wasip1 --no-default-features" +for crate in "${wasm_crates[@]}"; do + cmd="cargo +stable build -p $crate --target wasm32-wasip1 --no-default-features" if [ -n "$CI" ]; then echo "::group::$cmd" else - printf "\n%s:\n %s\n" "$package" "$cmd" + printf "\n%s:\n %s\n" "$crate" "$cmd" fi # Run the command and capture the return code @@ -38,9 +38,9 @@ for package in "${wasm_packages[@]}"; do # Store the result in the dictionary if [ $ret_code -eq 0 ]; then - results["$package"]="✅" + results+=("✅:$crate") else - results["$package"]="❌" + results+=("❌:$crate") any_failed=1 fi @@ -49,10 +49,16 @@ for package in "${wasm_packages[@]}"; do fi done +# Sort the results by status and then by crate name +IFS=$'\n' sorted_results=($(sort <<<"${results[*]}")) +unset IFS + # Print summary echo -e "\nSummary of build results:" -for package in "${!results[@]}"; do - echo "$package: ${results[$package]}" +for result in "${sorted_results[@]}"; do + status="${result%%:*}" + crate="${result##*:}" + echo "$status $crate" done # Exit with a non-zero status if any command fails