Skip to content

Commit e9d744c

Browse files
committed
fix: Improve anvil cleanup process and streamline deployment steps
1 parent afae923 commit e9d744c

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,34 +76,15 @@ jobs:
7676
ANVIL_SEPOLIA_RPC_URL: http://localhost:8545
7777
ANVIL_ARBITRUM_SEPOLIA_RPC_URL: http://localhost:8546
7878
run: |
79-
# Clean up any existing anvil processes
80-
make cleanup-anvil
81-
82-
# Start anvil forks in background
79+
forge cache clean all &
8380
make fork-sepolia &
84-
ANVIL_SEPOLIA_PID=$!
8581
make fork-arbitrum-sepolia &
86-
ANVIL_ARBITRUM_PID=$!
8782
8883
# Wait for anvil instances to be ready
89-
echo "Waiting for anvil instances to start..."
9084
sleep 5
9185
92-
# Check if anvil processes are running
93-
if ! kill -0 $ANVIL_SEPOLIA_PID 2>/dev/null; then
94-
echo "Error: Anvil Sepolia fork failed to start"
95-
exit 1
96-
fi
97-
if ! kill -0 $ANVIL_ARBITRUM_PID 2>/dev/null; then
98-
echo "Error: Anvil Arbitrum fork failed to start"
99-
exit 1
100-
fi
101-
10286
# Deploy all contracts using the Makefile target
10387
make deploy-on-anvil
104-
105-
# Clean up anvil processes
106-
make cleanup-anvil
10788
10889
- name: Deploy contracts on Ethereum Mainnet or Sepolia
10990
if: inputs.network == 'sepolia' || inputs.network == 'ethereum'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ clean:
4646

4747
cleanup-anvil:
4848
@echo "Stopping all anvil processes..."
49-
@pkill -f "anvil.*port" || true
49+
@-pkill -f "anvil.*port" 2>/dev/null || echo "No anvil processes found to stop"
5050
@sleep 2
5151
@echo "Anvil cleanup completed."
5252

0 commit comments

Comments
 (0)