-
Notifications
You must be signed in to change notification settings - Fork 393
107 lines (97 loc) · 4.42 KB
/
validate-templates.yml
File metadata and controls
107 lines (97 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Validate Templates
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
validate-template:
name: ${{ matrix.template }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- template: template-generic
setup_target: "setup-task"
setup_args: "network=sepolia task=ci-test"
task_dir_suffix: ci-test
- template: template-funding
setup_target: "setup-funding"
setup_args: "network=sepolia"
task_dir_suffix: funding
- template: template-gas-increase
setup_target: "setup-gas-increase"
setup_args: "network=sepolia"
task_dir_suffix: increase-gas-limit
- template: template-gas-and-elasticity-increase
setup_target: "setup-gas-and-elasticity-increase"
setup_args: "network=sepolia"
task_dir_suffix: increase-gas-and-elasticity-limit
- template: template-safe-management
setup_target: "setup-safe-management"
setup_args: "network=sepolia"
task_dir_suffix: safe-management
- template: template-upgrade-fault-proofs
setup_target: "setup-upgrade-fault-proofs"
setup_args: "network=sepolia"
task_dir_suffix: upgrade-fault-proofs
- template: template-pause-bridge-base
setup_target: "setup-bridge-pause"
setup_args: "network=sepolia"
task_dir_suffix: pause-bridge-base
- template: template-pause-superchain-config
setup_target: "setup-superchain-config-pause"
setup_args: "network=sepolia"
task_dir_suffix: pause-superchain-config
- template: template-set-bridge-partner-threshold
setup_target: "setup-bridge-partner-threshold"
setup_args: "network=sepolia"
task_dir_suffix: pause-bridge-base
- template: template-switch-to-permissioned-game
setup_target: "setup-switch-to-permissioned-game"
setup_args: "network=sepolia"
task_dir_suffix: switch-to-permissioned-game
fail-fast: false
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# ── Foundry ──────────────────────────────────────────────────────
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
with:
version: stable
# ── Setup & Dependencies ────────────────────────────────────────
- name: Create sample task from template
id: setup
run: |
make ${{ matrix.setup_target }} ${{ matrix.setup_args }}
TASK_DIR="sepolia/$(date +'%Y-%m-%d')-${{ matrix.task_dir_suffix }}"
echo "task_dir=$TASK_DIR" >> "$GITHUB_OUTPUT"
- name: Install dependencies
working-directory: ${{ steps.setup.outputs.task_dir }}
run: make deps
# ── Validation ───────────────────────────────────────────────────
- name: Check Solidity formatting
working-directory: ${{ steps.setup.outputs.task_dir }}
run: |
echo "==> forge fmt --check script/ (${{ matrix.template }})"
if ! forge fmt --check script/; then
echo ""
echo "::error::Formatting check failed for ${{ matrix.template }}. Run 'forge fmt script/' in the template directory to fix."
exit 1
fi
- name: Build (forge build)
working-directory: ${{ steps.setup.outputs.task_dir }}
run: |
echo "==> forge build (${{ matrix.template }})"
if ! forge build; then
echo ""
echo "::error::Compilation failed for ${{ matrix.template }}. Check imports, types, and dependency versions."
exit 1
fi