-
Notifications
You must be signed in to change notification settings - Fork 11
163 lines (136 loc) · 4.46 KB
/
foundry.yml
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
name: Foundry
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build-via-ir:
name: Compilation (via IR)
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
- uses: ./.github/actions/install
- name: Build contracts via IR & check sizes
run: yarn build:forge --force # don't use compilation cache
build-no-ir:
name: Compilation (without IR)
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
- uses: ./.github/actions/install-cache
- name: Build contracts without IR
run: yarn build:forge
env:
FOUNDRY_PROFILE: test
- name: Save forge compilation cache
uses: actions/cache/save@v3
with:
path: |
cache
out
key: forge-${{ github.ref_name }}
test-local:
needs: build-no-ir
name: Local tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
type: ["slow", "fast"]
include:
- type: "slow"
fuzz-runs: 25000
max-test-rejects: 10000
invariant-runs: 64
invariant-depth: 1024
- type: "fast"
fuzz-runs: 4096
max-test-rejects: 65536
invariant-runs: 16
invariant-depth: 256
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
- uses: ./.github/actions/install-cache
- name: Run local tests in ${{ matrix.type }} mode
run: yarn test:forge:local
env:
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
test-mainnet:
needs: build-no-ir
name: Ethereum tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
type: ["slow", "fast"]
include:
- type: "slow"
fuzz-runs: 128
max-test-rejects: 65536
invariant-runs: 16
invariant-depth: 1024
- type: "fast"
fuzz-runs: 32
max-test-rejects: 65536
invariant-runs: 4
invariant-depth: 256
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
- uses: ./.github/actions/install-cache
- name: Run mainnet tests in ${{ matrix.type }} mode
run: yarn test:forge:mainnet
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}