-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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): add rv32im compilation checks #12925
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f2d4b3a
add rv32im workflow
zobront b11fc31
loosen requirements to rv32imac
zobront d3b085d
invert to check only listed crates
zobront bd46961
reduce crates to check to current successes
zobront 4f0078f
add back target crates commented out
zobront File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
#!/usr/bin/env bash | ||
set +e # Disable immediate exit on error | ||
|
||
# Array of crates to compile | ||
crates=($(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | grep '^reth' | sort)) | ||
|
||
# Array of crates to exclude | ||
# Used with the `contains` function. | ||
# shellcheck disable=SC2034 | ||
exclude_crates=( | ||
# # The following are not working yet, but known to be fixable | ||
# reth-exex-types # https://github.com/paradigmxyz/reth/issues/9946 | ||
# # The following require investigation if they can be fixed | ||
# reth-basic-payload-builder | ||
# reth-beacon-consensus | ||
# reth-bench | ||
# reth-blockchain-tree | ||
# reth-cli | ||
# reth-cli-commands | ||
# reth-cli-runner | ||
# reth-consensus-debug-client | ||
# reth-db-common | ||
# reth-discv4 | ||
# reth-discv5 | ||
# reth-dns-discovery | ||
# reth-downloaders | ||
# reth-e2e-test-utils | ||
# reth-engine-service | ||
# reth-engine-tree | ||
# reth-engine-util | ||
# reth-eth-wire | ||
# reth-ethereum-cli | ||
# reth-ethereum-payload-builder | ||
# reth-etl | ||
# reth-exex | ||
# reth-exex-test-utils | ||
# reth-ipc | ||
# reth-net-nat | ||
# reth-network | ||
# reth-node-api | ||
# reth-node-builder | ||
# reth-node-core | ||
# reth-node-ethereum | ||
# reth-node-events | ||
# reth-node-metrics | ||
# reth-optimism-cli | ||
# reth-optimism-node | ||
# reth-optimism-payload-builder | ||
# reth-optimism-rpc | ||
# reth-optimism-primitives | ||
# reth-rpc | ||
# reth-rpc-api | ||
# reth-rpc-api-testing-util | ||
# reth-rpc-builder | ||
# reth-rpc-engine-api | ||
# reth-rpc-eth-api | ||
# reth-rpc-eth-types | ||
# reth-rpc-layer | ||
# reth-stages | ||
# reth-engine-local | ||
# # The following are not supposed to be working | ||
# reth # all of the crates below | ||
# reth-invalid-block-hooks # reth-provider | ||
# reth-libmdbx # mdbx | ||
# reth-mdbx-sys # mdbx | ||
# reth-provider # tokio | ||
# reth-prune # tokio | ||
# reth-stages-api # reth-provider, reth-prune | ||
# reth-static-file # tokio | ||
# reth-transaction-pool # c-kzg | ||
# reth-trie-parallel # tokio | ||
# reth-testing-utils | ||
# # The following failed the initial risc-v test | ||
# reth-blockchain-tree-api | ||
# reth-chain-state | ||
# reth-chainspec | ||
# reth-cli-util | ||
# reth-codecs | ||
# reth-config | ||
# reth-consensus | ||
# reth-consensus-common | ||
# reth-db | ||
# reth-db-api | ||
# reth-db-models | ||
# reth-ecies | ||
# reth-engine-primitives | ||
# reth-errors | ||
# reth-eth-wire-types | ||
# reth-ethereum-consensus | ||
# reth-ethereum-engine-primitives | ||
# reth-ethereum-forks | ||
# reth-evm | ||
# reth-evm-ethereum | ||
# reth-execution-errors | ||
# reth-execution-types | ||
# reth-fs-util | ||
# reth-metrics | ||
# reth-net-banlist | ||
# reth-network-api | ||
# reth-network-p2p | ||
# reth-network-peers | ||
# reth-network-types | ||
# reth-nippy-jar | ||
# reth-node-types | ||
# reth-optimism-chainspec | ||
# reth-optimism-consensus | ||
# reth-optimism-evm | ||
# reth-optimism-forks | ||
# reth-optimism-storage | ||
# reth-payload-builder | ||
# reth-payload-builder-primitives | ||
# reth-payload-primitives | ||
# reth-payload-util | ||
# reth-payload-validator | ||
# reth-primitives | ||
# reth-primitives-traits | ||
# reth-prune-types | ||
# reth-revm | ||
# reth-rpc-server-types | ||
# reth-rpc-types-compat | ||
# reth-stages-types | ||
# reth-static-file-types | ||
# reth-storage-api | ||
# reth-storage-errors | ||
# reth-tasks | ||
# reth-tokio-util | ||
# reth-tracing | ||
# reth-trie | ||
# reth-trie-common | ||
# reth-trie-db | ||
# reth-trie-sparse | ||
) | ||
|
||
# Array to hold the results | ||
results=() | ||
# Flag to track if any command fails | ||
any_failed=0 | ||
|
||
# Function to check if a value exists in an array | ||
contains() { | ||
local array="$1[@]" | ||
local seeking=$2 | ||
local in=1 | ||
for element in "${!array}"; do | ||
if [[ "$element" == "$seeking" ]]; then | ||
in=0 | ||
break | ||
fi | ||
done | ||
return $in | ||
} | ||
|
||
for crate in "${crates[@]}"; do | ||
if contains exclude_crates "$crate"; then | ||
results+=("3:⏭️:$crate") | ||
continue | ||
fi | ||
|
||
cmd="cargo +stable build -p $crate --target riscv32im-unknown-none-elf --no-default-features" | ||
|
||
if [ -n "$CI" ]; then | ||
echo "::group::$cmd" | ||
else | ||
printf "\n%s:\n %s\n" "$crate" "$cmd" | ||
fi | ||
|
||
set +e # Disable immediate exit on error | ||
# Run the command and capture the return code | ||
$cmd | ||
ret_code=$? | ||
set -e # Re-enable immediate exit on error | ||
|
||
# Store the result in the dictionary | ||
if [ $ret_code -eq 0 ]; then | ||
results+=("1:✅:$crate") | ||
else | ||
results+=("2:❌:$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#*:}" | ||
status="${status%%:*}" | ||
crate="${result##*:}" | ||
echo "$status $crate" | ||
done | ||
|
||
# Exit with a non-zero status if any command fails | ||
exit $any_failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we invert this please,
checking crates for inclusion is pretty annoying, because what we need to do here now is check that a selection of crates compiles for this target, then we don't need the cargo metadata call