mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(ci): check_no_std -> check_wasm (#9982)
This commit is contained in:
35
.github/assets/check_no_std.sh
vendored
35
.github/assets/check_no_std.sh
vendored
@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
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
|
|
||||||
# the following are confirmed working
|
|
||||||
reth-errors
|
|
||||||
reth-ethereum-forks
|
|
||||||
reth-network-peers
|
|
||||||
reth-primitives-traits
|
|
||||||
reth-codecs
|
|
||||||
)
|
|
||||||
|
|
||||||
for package in "${no_std_packages[@]}"; do
|
|
||||||
cmd="cargo +stable build -p $package --target wasm32-wasip1 --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
|
|
||||||
65
.github/assets/check_wasm.sh
vendored
Executable file
65
.github/assets/check_wasm.sh
vendored
Executable file
@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set +e # Disable immediate exit on error
|
||||||
|
|
||||||
|
# Array of crates
|
||||||
|
wasm_crates=(
|
||||||
|
# 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
|
||||||
|
)
|
||||||
|
|
||||||
|
# Array to hold the results
|
||||||
|
results=()
|
||||||
|
# Flag to track if any command fails
|
||||||
|
any_failed=0
|
||||||
|
|
||||||
|
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" "$crate" "$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+=("✅:$crate")
|
||||||
|
else
|
||||||
|
results+=("❌:$crate")
|
||||||
|
any_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$CI" ]; then
|
||||||
|
echo "::endgroup::"
|
||||||
|
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 result in "${sorted_results[@]}"; do
|
||||||
|
status="${result%%:*}"
|
||||||
|
crate="${result##*:}"
|
||||||
|
echo "$status $crate"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Exit with a non-zero status if any command fails
|
||||||
|
exit $any_failed
|
||||||
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUSTFLAGS: -D warnings
|
RUSTFLAGS: -D warnings
|
||||||
|
|
||||||
no-std:
|
wasm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
@ -57,8 +57,8 @@ jobs:
|
|||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-on-failure: true
|
cache-on-failure: true
|
||||||
- name: Run no_std checks
|
- name: Run Wasm checks
|
||||||
run: .github/assets/check_no_std.sh
|
run: .github/assets/check_wasm.sh
|
||||||
|
|
||||||
crate-checks:
|
crate-checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Reference in New Issue
Block a user