-
Notifications
You must be signed in to change notification settings - Fork 11
155 lines (127 loc) · 4.04 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
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@v2
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
# don't use compilation cache
# skip import files, because we don't care if contracts are too big
run: yarn build:forge --force --sizes --skip Import
build-no-ir:
name: Compilation (without IR)
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
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
- type: "fast"
fuzz-runs: 2048
max-test-rejects: 65536
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
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 on chain ${{ matrix.chain }} 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_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
test-fork:
needs: build-no-ir
name: Fork tests (chainid=${{ matrix.chain }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
chain: [1, 8453]
type: ["slow", "fast"]
include:
- type: "slow"
fuzz-runs: 96
max-test-rejects: 65536
- type: "fast"
fuzz-runs: 16
max-test-rejects: 65536
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
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 fork tests on chain ${{ matrix.chain }} in ${{ matrix.type }} mode
run: yarn test:forge:fork --chain ${{ matrix.chain }}
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}