mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
ci: add on-demand workflow to check alloy breaking changes (#21267)
This commit is contained in:
66
.github/workflows/check-alloy.yml
vendored
Normal file
66
.github/workflows/check-alloy.yml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
# Checks reth compilation against alloy branches to detect breaking changes.
|
||||
# Run on-demand via workflow_dispatch.
|
||||
|
||||
name: Check Alloy Breaking Changes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
alloy_branch:
|
||||
description: 'Branch/rev for alloy-rs/alloy (leave empty to skip)'
|
||||
required: false
|
||||
type: string
|
||||
alloy_evm_branch:
|
||||
description: 'Branch/rev for alloy-rs/evm (alloy-evm, alloy-op-evm) (leave empty to skip)'
|
||||
required: false
|
||||
type: string
|
||||
op_alloy_branch:
|
||||
description: 'Branch/rev for alloy-rs/op-alloy (leave empty to skip)'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check compilation with patched alloy
|
||||
runs-on: depot-ubuntu-latest-16
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Apply alloy patches
|
||||
run: |
|
||||
ARGS=""
|
||||
if [ -n "${{ inputs.alloy_branch }}" ]; then
|
||||
ARGS="$ARGS --alloy ${{ inputs.alloy_branch }}"
|
||||
fi
|
||||
if [ -n "${{ inputs.alloy_evm_branch }}" ]; then
|
||||
ARGS="$ARGS --evm ${{ inputs.alloy_evm_branch }}"
|
||||
fi
|
||||
if [ -n "${{ inputs.op_alloy_branch }}" ]; then
|
||||
ARGS="$ARGS --op ${{ inputs.op_alloy_branch }}"
|
||||
fi
|
||||
|
||||
if [ -z "$ARGS" ]; then
|
||||
echo "No branches specified, nothing to patch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./scripts/patch-alloy.sh $ARGS
|
||||
|
||||
echo "=== Final patch section ==="
|
||||
tail -50 Cargo.toml
|
||||
|
||||
- name: Check workspace
|
||||
run: cargo check --workspace --all-features
|
||||
|
||||
- name: Check Optimism
|
||||
run: cargo check -p reth-optimism-node --all-features
|
||||
114
scripts/patch-alloy.sh
Executable file
114
scripts/patch-alloy.sh
Executable file
@@ -0,0 +1,114 @@
|
||||
#!/usr/bin/env bash
|
||||
# Patches alloy dependencies in Cargo.toml for testing breaking changes.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/patch-alloy.sh [--alloy <branch>] [--evm <branch>] [--op <branch>]
|
||||
#
|
||||
# Examples:
|
||||
# ./scripts/patch-alloy.sh --alloy main
|
||||
# ./scripts/patch-alloy.sh --alloy feat/new-api --evm main
|
||||
# ./scripts/patch-alloy.sh --alloy main --evm main --op main
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ALLOY_BRANCH=""
|
||||
ALLOY_EVM_BRANCH=""
|
||||
OP_ALLOY_BRANCH=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--alloy)
|
||||
ALLOY_BRANCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--evm)
|
||||
ALLOY_EVM_BRANCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--op)
|
||||
OP_ALLOY_BRANCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [--alloy <branch>] [--evm <branch>] [--op <branch>]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --alloy <branch> Patch alloy-rs/alloy crates"
|
||||
echo " --evm <branch> Patch alloy-rs/evm crates (alloy-evm, alloy-op-evm)"
|
||||
echo " --op <branch> Patch alloy-rs/op-alloy crates"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$ALLOY_BRANCH" && -z "$ALLOY_EVM_BRANCH" && -z "$OP_ALLOY_BRANCH" ]]; then
|
||||
echo "Error: At least one of --alloy, --evm, or --op must be specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CARGO_TOML="${CARGO_TOML:-Cargo.toml}"
|
||||
|
||||
echo "Patching $CARGO_TOML..."
|
||||
echo "" >> "$CARGO_TOML"
|
||||
|
||||
if [[ -n "$ALLOY_BRANCH" ]]; then
|
||||
echo "Patching alloy-rs/alloy with branch: $ALLOY_BRANCH"
|
||||
cat >> "$CARGO_TOML" << EOF
|
||||
# Patched by patch-alloy.sh
|
||||
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-contract = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-eips = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-network = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-provider = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-debug = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-serde = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-signer = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-transport = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", branch = "$ALLOY_BRANCH" }
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ -n "$ALLOY_EVM_BRANCH" ]]; then
|
||||
echo "Patching alloy-rs/evm with branch: $ALLOY_EVM_BRANCH"
|
||||
cat >> "$CARGO_TOML" << EOF
|
||||
alloy-evm = { git = "https://github.com/alloy-rs/evm", branch = "$ALLOY_EVM_BRANCH" }
|
||||
alloy-op-evm = { git = "https://github.com/alloy-rs/evm", branch = "$ALLOY_EVM_BRANCH" }
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ -n "$OP_ALLOY_BRANCH" ]]; then
|
||||
echo "Patching alloy-rs/op-alloy with branch: $OP_ALLOY_BRANCH"
|
||||
cat >> "$CARGO_TOML" << EOF
|
||||
op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", branch = "$OP_ALLOY_BRANCH" }
|
||||
op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", branch = "$OP_ALLOY_BRANCH" }
|
||||
op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", branch = "$OP_ALLOY_BRANCH" }
|
||||
op-alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/op-alloy", branch = "$OP_ALLOY_BRANCH" }
|
||||
op-alloy-rpc-jsonrpsee = { git = "https://github.com/alloy-rs/op-alloy", branch = "$OP_ALLOY_BRANCH" }
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo "Done. Patches appended to $CARGO_TOML"
|
||||
echo ""
|
||||
echo "Run 'cargo check --workspace --all-features' to verify compilation."
|
||||
echo "Run 'git checkout $CARGO_TOML' to revert changes."
|
||||
Reference in New Issue
Block a user