diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8d889d4..257181c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -22,42 +22,8 @@ jobs: cache-on-failure: true - name: Run examples run: | - # Get the list of runnable examples - export examples="$( - cargo run --example 2>&1 \ - | grep -E '^ ' \ - | grep -v \ - -e 'any_network' \ - -e 'builtin' \ - -e 'geth_local_instance' \ - -e 'ipc' \ - -e 'ledger_signer' \ - -e 'reth_db_layer' \ - -e 'reth_db_provider' \ - -e 'reth_local_instance' \ - -e 'subscribe_all_logs' \ - -e 'subscribe_logs' \ - -e 'subscribe_pending_transactions' \ - -e 'trace_call' \ - -e 'trace_transaction' \ - -e 'trezor_signer' \ - -e 'ws_auth' \ - -e 'ws' \ - -e 'yubi_signer' \ - | xargs -n1 echo - )" - - # Run the examples with the current version of Alloy - for example in $examples; do - cargo run --example $example --quiet 1>/dev/null - - if [ $? -ne 0 ]; then - echo "Failed to run: $example" - exit 1 - else - echo "Successfully ran: $example" - fi - done + # Run examples with the current version of Alloy + ./scripts/run.sh # Fetch the latest commit hash of the `main` branch from the Alloy repository export latest_alloy_commit=$(git ls-remote https://github.com/alloy-rs/alloy.git \ @@ -72,13 +38,4 @@ jobs: cargo update # Run the examples with the latest version of Alloy - for example in $examples; do - cargo run --example $example --quiet 1>/dev/null - - if [ $? -ne 0 ]; then - echo "Failed to run: $example" - exit 1 - else - echo "Successfully ran: $example" - fi - done + ./scripts/run.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e88dc1a..97a24d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,41 +39,4 @@ jobs: with: cache-on-failure: true - name: Run examples - run: | - # Get the list of runable examples, excluding the ones listed below - export examples="$( - cargo run --example 2>&1 \ - | grep -E '^ ' \ - | grep -v \ - -e 'any_network' \ - -e 'builtin' \ - -e 'geth_local_instance' \ - -e 'ipc' \ - -e 'ledger_signer' \ - -e 'reth_local_instance' \ - -e 'reth_db_layer' \ - -e 'reth_db_provider' \ - -e 'subscribe_all_logs' \ - -e 'subscribe_logs' \ - -e 'subscribe_pending_transactions' \ - -e 'trace_call' \ - -e 'trace_transaction' \ - -e 'trezor_signer' \ - -e 'ws_auth' \ - -e 'ws' \ - -e 'yubi_signer' \ - -e 'reth_db_provider' \ - | xargs -n1 echo - )" - - # Run the examples - for example in $examples; do - cargo run --example $example --quiet 1>/dev/null - - if [ $? -ne 0 ]; then - echo "Failed to run: $example" - exit 1 - else - echo "Successfully ran: $example" - fi - done + run: ./scripts/run.sh diff --git a/scripts/run.sh b/scripts/run.sh index ee0b373..2fe2055 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -8,32 +8,29 @@ set -eo pipefail # 1. Run all examples with some exceptions. function main () { export examples="$( - cargo run --example 2>&1 \ - | grep -E '^ ' \ - | grep -v \ - -e 'any_network' \ - -e 'builtin' \ - -e 'geth_local_instance' \ - -e 'ipc' \ - -e 'ledger_signer' \ - -e 'reth_db_layer' \ - -e 'reth_db_provider' \ - -e 'reth_local_instance' \ - -e 'subscribe_all_logs' \ - -e 'subscribe_logs' \ - -e 'subscribe_pending_transactions' \ - -e 'trace_call' \ - -e 'trace_transaction' \ - -e 'trezor_signer' \ - -e 'ws_auth' \ - -e 'ws' \ - -e 'yubi_signer' \ - | xargs -n1 echo + cargo run --example 2>&1 \ + | grep -E '^ ' \ + | grep -v \ + -e 'any_network' \ + -e 'builtin' \ + -e 'geth_local_instance' \ + -e 'ipc' \ + -e 'ledger_signer' \ + -e 'reth_db_layer' \ + -e 'reth_db_provider' \ + -e 'reth_local_instance' \ + -e 'subscribe_all_logs' \ + -e 'subscribe_logs' \ + -e 'subscribe_pending_transactions' \ + -e 'trace_call' \ + -e 'trace_transaction' \ + -e 'trezor_signer' \ + -e 'ws_auth' \ + -e 'ws' \ + -e 'yubi_signer' \ + | xargs -n1 echo )" - # Build the examples - cargo build --examples --quiet - # Run the examples with the current version of Alloy for example in $examples; do cargo run --example $example --quiet 1>/dev/null