Skip to content

Commit fc7bf5d

Browse files
committed
ci: add weekly deployment validation workflow
1 parent 204fb3d commit fc7bf5d

1 file changed

Lines changed: 135 additions & 55 deletions

File tree

Lines changed: 135 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,151 @@
1-
name: Weekly Chain Validation
1+
# Weekly Deployment Validation
2+
#
3+
# Runs live fork tests from the `live-validators` branch against all deployed networks.
4+
# The `live-validators` branch is pinned to the latest deployed protocol version.
5+
#
6+
# To update after a new deployment:
7+
# git push origin <release-tag-or-commit>:refs/heads/live-validators --force
8+
#
9+
# Schedule triggers only fire on the default branch (main), so this file must
10+
# live on main even though it checks out `live-validators` for test execution.
11+
12+
name: Weekly Deployment Validation
213

314
on:
415
schedule:
5-
# Run every Monday at 6:00 AM UTC (7:00 AM CET)
6-
- cron: "0 6 * * 1"
16+
- cron: "15 6 * * 1" # Monday 6:15 AM UTC
717
workflow_dispatch:
8-
# Allow manual triggering for testing
18+
inputs:
19+
branch:
20+
description: "Branch to validate (default: live-validators)"
21+
required: false
22+
default: "live-validators"
23+
24+
env:
25+
FOUNDRY_PROFILE: ci
926

1027
jobs:
11-
validate-chains:
28+
validate-state:
1229
runs-on: ubuntu-latest
13-
timeout-minutes: 20
30+
timeout-minutes: 30
31+
permissions:
32+
contents: "read"
33+
id-token: "write"
1434
strategy:
35+
fail-fast: false
1536
matrix:
16-
chain:
17-
- name: "Ethereum"
18-
test: "test_validateEthereum"
19-
emoji: "🌐"
20-
# rpc_secret: "ETH_RPC_URL"
21-
- name: "Base"
22-
test: "test_validateBase"
23-
emoji: "🔵"
24-
# rpc_secret: "BASE_RPC_URL"
25-
- name: "Arbitrum"
26-
test: "test_validateArbitrum"
27-
emoji: "🔶"
28-
# rpc_secret: "ARBITRUM_RPC_URL"
29-
- name: "Avalanche"
30-
test: "test_validateAvalanche"
31-
emoji: "🏔️"
32-
# rpc_secret: "AVAX_RPC_URL"
33-
- name: "BNB"
34-
test: "test_validateBNB"
35-
emoji: "🟡"
36-
# rpc_secret: "BNB_RPC_URL"
37-
- name: "Plume"
38-
test: "test_validatePlume"
39-
emoji: "🟣"
40-
# rpc_secret: "PLUME_RPC_URL"
41-
42-
name: "Validate ${{ matrix.chain.name }}"
43-
37+
network: [ethereum, base, arbitrum, plume, avalanche, bnb-smart-chain, optimism, hyper-evm, monad]
38+
name: "State: ${{ matrix.network }}"
4439
steps:
45-
- name: Checkout repository
46-
uses: actions/checkout@v4
47-
48-
- name: Install Foundry
49-
uses: foundry-rs/foundry-toolchain@v1
40+
- uses: actions/checkout@v4
5041
with:
51-
version: v1.4.1
52-
53-
- name: Create build cache
54-
uses: actions/cache@v4
42+
ref: ${{ inputs.branch || 'live-validators' }}
43+
- uses: google-github-actions/auth@v2
5544
with:
45+
workload_identity_provider: ${{ secrets.GCP_WIP }}
46+
service_account: ${{ secrets.GCP_SA }}
47+
- uses: google-github-actions/setup-gcloud@v2
48+
- uses: foundry-rs/foundry-toolchain@v1
49+
with:
50+
version: v1.4.4
51+
- run: python3 script/deploy/load_secrets.py
52+
- run: forge test --match-test "testLiveValidation" -vv 2>&1 | tee test-output.txt
53+
env:
54+
NETWORK: ${{ matrix.network }}
55+
- if: failure()
56+
run: echo "${{ matrix.network }}" > failed-chain.txt
57+
- if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: failure-state-${{ matrix.network }}
5661
path: |
57-
cache
58-
out
59-
key: ${{ runner.os }}-foundry-${{ hashFiles('lib/**', 'src/**', 'test/**') }}
60-
restore-keys: |
61-
${{ runner.os }}-foundry-
62+
failed-chain.txt
63+
test-output.txt
6264
63-
- name: Install dependencies
64-
run: forge install --no-commit
65+
validate-flows:
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 30
68+
permissions:
69+
contents: "read"
70+
id-token: "write"
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
network: [ethereum, base, arbitrum, plume, avalanche, bnb-smart-chain, optimism, hyper-evm, monad]
75+
name: "Flows: ${{ matrix.network }}"
76+
steps:
77+
- uses: actions/checkout@v4
78+
with:
79+
ref: ${{ inputs.branch || 'live-validators' }}
80+
- uses: google-github-actions/auth@v2
81+
with:
82+
workload_identity_provider: ${{ secrets.GCP_WIP }}
83+
service_account: ${{ secrets.GCP_SA }}
84+
- uses: google-github-actions/setup-gcloud@v2
85+
- uses: foundry-rs/foundry-toolchain@v1
86+
with:
87+
version: v1.4.4
88+
- run: python3 script/deploy/load_secrets.py
89+
- run: forge test --match-test "testInvestmentFlows" -vv 2>&1 | tee test-output.txt
90+
env:
91+
NETWORK: ${{ matrix.network }}
92+
- if: failure()
93+
run: echo "${{ matrix.network }}" > failed-chain.txt
94+
- if: failure()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: failure-flows-${{ matrix.network }}
98+
path: |
99+
failed-chain.txt
100+
test-output.txt
65101
66-
- name: Validate ${{ matrix.chain.name }} deployment
67-
# env:
68-
# ${{ matrix.chain.rpc_secret }}: ${{ secrets[matrix.chain.rpc_secret] }}
102+
report-failures:
103+
needs: [validate-state, validate-flows]
104+
if: failure()
105+
runs-on: ubuntu-latest
106+
permissions:q
107+
contents: read
108+
issues: write
109+
steps:
110+
- uses: actions/download-artifact@v4
111+
with:
112+
pattern: failure-*
113+
path: failures
114+
- name: Build failure summary
115+
id: summary
69116
run: |
70-
echo "${{ matrix.chain.emoji }} Validating ${{ matrix.chain.name }} deployment..."
71-
forge test --match-test ${{ matrix.chain.test }} -vv
117+
CHAINS=""
118+
DETAILS=""
119+
for dir in failures/failure-*/; do
120+
[ -d "$dir" ] || continue
121+
chain=$(cat "$dir/failed-chain.txt" 2>/dev/null || echo "unknown")
122+
type=$(basename "$dir" | sed 's/failure-//' | sed "s/-${chain}//")
123+
CHAINS="${CHAINS}- **${chain}** (${type})\n"
124+
DETAILS="${DETAILS}<details><summary>${chain} (${type})</summary>\n\n\`\`\`\n$(tail -50 "$dir/test-output.txt" 2>/dev/null || echo "No output")\n\`\`\`\n</details>\n\n"
125+
done
126+
{
127+
echo "chains<<EOF"
128+
echo -e "$CHAINS"
129+
echo "EOF"
130+
echo "details<<EOF"
131+
echo -e "$DETAILS"
132+
echo "EOF"
133+
} >> "$GITHUB_OUTPUT"
134+
- name: Create GitHub issue
135+
uses: actions/github-script@v7
136+
with:
137+
script: |
138+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
139+
await github.rest.issues.create({
140+
owner: context.repo.owner,
141+
repo: context.repo.repo,
142+
title: `Weekly Validation Failure — ${new Date().toISOString().slice(0, 10)}`,
143+
labels: ['validation-failure'],
144+
body: `## Weekly deployment validation failed\n\n` +
145+
`**Run:** ${runUrl}\n\n` +
146+
`### Failing networks\n\n${process.env.CHAINS}\n` +
147+
`### Error details\n\n${process.env.DETAILS}`
148+
});
149+
env:
150+
CHAINS: ${{ steps.summary.outputs.chains }}
151+
DETAILS: ${{ steps.summary.outputs.details }}

0 commit comments

Comments
 (0)