-
Notifications
You must be signed in to change notification settings - Fork 112
197 lines (184 loc) · 6.33 KB
/
Copy pathfoundry.yml
File metadata and controls
197 lines (184 loc) · 6.33 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Foundry
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
- staging
- stable
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: foundry-${{ github.ref }}
jobs:
# ── Formatting & Lint ───────────────────────────────────────
fmt:
name: Formatting & Lint
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Check Solidity formatting (forge)
working-directory: contracts
run: forge fmt --check scripts/ tests/
- name: Check JS formatting (prettier)
working-directory: contracts
run: npx prettier -c "*.js" "deploy/**/*.js" "scripts/**/*.js" "tasks/**/*.js" "test/**/*.js" "utils/**/*.js"
- name: Check Solidity formatting (prettier)
working-directory: contracts
run: npx prettier -c --plugin=prettier-plugin-solidity "contracts/**/*.sol"
- name: Lint
working-directory: contracts
run: pnpm run lint
- name: Check unused imports
working-directory: contracts
run: make lint-imports
# ── Build ───────────────────────────────────────────────────
build:
name: Build
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Check contract sizes
working-directory: contracts
run: forge build --sizes --skip "test/**" --skip "tests/**" --skip "script/**" --skip "scripts/**"
# ── Unit Tests ──────────────────────────────────────────────
unit-tests:
name: Unit Tests
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run unit tests
working-directory: contracts
run: make test-unit
# ── Fork Tests ──────────────────────────────────────────────
fork-tests-mainnet:
name: Fork Tests (Mainnet)
runs-on: ubuntu-latest
env:
MAINNET_PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
BEACON_PROVIDER_URL: ${{ secrets.BEACON_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Mainnet fork tests
working-directory: contracts
run: make test-fork-mainnet
fork-tests-base:
name: Fork Tests (Base)
runs-on: ubuntu-latest
env:
BASE_PROVIDER_URL: ${{ secrets.BASE_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Base fork tests
working-directory: contracts
run: make test-fork-base
fork-tests-hyperevm:
name: Fork Tests (HyperEVM)
runs-on: ubuntu-latest
env:
HYPEREVM_PROVIDER_URL: ${{ secrets.HYPEREVM_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run HyperEVM fork tests
working-directory: contracts
run: make test-fork-hyperevm
# ── Smoke Tests ─────────────────────────────────────────────
smoke-tests-mainnet:
name: Smoke Tests (Mainnet)
runs-on: ubuntu-latest
env:
MAINNET_PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Mainnet smoke tests
working-directory: contracts
run: make test-smoke-mainnet
smoke-tests-base:
name: Smoke Tests (Base)
runs-on: ubuntu-latest
env:
BASE_PROVIDER_URL: ${{ secrets.BASE_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Base smoke tests
working-directory: contracts
run: make test-smoke-base
smoke-tests-hyperevm:
name: Smoke Tests (HyperEVM)
runs-on: ubuntu-latest
env:
HYPEREVM_PROVIDER_URL: ${{ secrets.HYPEREVM_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run HyperEVM smoke tests
working-directory: contracts
run: make test-smoke-hyperevm
# ── Static Analysis ────────────────────────────────────────
slither:
name: Slither
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Slither
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.7/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc
pip3 install slither-analyzer
- name: Run Slither
working-directory: contracts
run: slither . --config-file slither.config.json
snyk:
name: Snyk
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high --all-projects