chore(clean up
): update use of Anvil instances
#298
Workflow file for this run
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
# Runs build checks and examples. | |
name: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: cargo hack | |
run: cargo hack check --feature-powerset --depth 2 | |
examples: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: foundry-rs/foundry-toolchain@v1 | |
- uses: Swatinem/rust-cache@v2 | |
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 '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 | |
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 |