Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): check_no_std -> check_wasm #9982

Merged
merged 8 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/assets/check_no_std.sh

This file was deleted.

65 changes: 65 additions & 0 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
RUSTFLAGS: -D warnings

no-std:
wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -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
Expand Down
Loading