-
Notifications
You must be signed in to change notification settings - Fork 756
216 lines (185 loc) · 6.65 KB
/
vm-pr.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: VM
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
env:
cwd: ${{github.workspace}}/packages/vm
defaults:
run:
working-directory: packages/vm
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
vm-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run lint
- run: npm run coverage
# - run: npm run test:API:browser -- disabled until we fix browser tests for vitest
- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: vm
vm-state:
runs-on: ubuntu-latest
strategy:
matrix:
fork: ['Berlin', 'London', 'Paris', 'Shanghai', 'Cancun']
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
vm-state-extended:
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
runs-on: ubuntu-latest
strategy:
matrix:
fork:
[
'Cancun',
'Shanghai',
'Paris',
'London',
'Berlin',
'MuirGlacier',
'Istanbul',
'Petersburg',
'Constantinople',
'Byzantium',
'SpuriousDragon',
'TangerineWhistle',
'Homestead',
'Chainstart',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests
vm-blockchain:
runs-on: ubuntu-latest
strategy:
matrix:
# Args to pass to the tester. Note that some have split the slow tests and only
# run on forks where applicable (see PR #489 for numbers on these)
# Tests were split with --dir and --excludeDir to balance execution times below the 9min mark.
args:
[
'--fork=Berlin --verify-test-amount-alltests',
'--fork=London --verify-test-amount-alltests',
'--fork=Paris --verify-test-amount-alltests',
'--fork=Shanghai --verify-test-amount-alltests',
'--fork=Cancun --verify-test-amount-alltests',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:blockchain -- ${{ matrix.args }}
vm-blockchain-extended:
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
runs-on: ubuntu-latest
strategy:
matrix:
# Args to pass to the tester.
args:
[
'--fork=Chainstart --verify-test-amount-alltests',
'--fork=Homestead --verify-test-amount-alltests',
'--fork=TangerineWhistle --verify-test-amount-alltests',
'--fork=SpuriousDragon --verify-test-amount-alltests',
'--fork=Byzantium --verify-test-amount-alltests',
'--fork=Constantinople --verify-test-amount-alltests',
'--fork=Petersburg --verify-test-amount-alltests',
'--fork=Istanbul --verify-test-amount-alltests',
'--fork=MuirGlacier --verify-test-amount-alltests',
'--fork=Berlin --verify-test-amount-alltests',
'--fork=London --verify-test-amount-alltests',
'--fork=Paris --verify-test-amount-alltests',
'--fork=Shanghai --verify-test-amount-alltests',
'--fork=Cancun --verify-test-amount-alltests',
'--fork=ByzantiumToConstantinopleFixAt5 --verify-test-amount-alltests',
'--fork=EIP158ToByzantiumAt5 --verify-test-amount-alltests',
'--fork=FrontierToHomesteadAt5 --verify-test-amount-alltests',
'--fork=HomesteadToDaoAt5 --verify-test-amount-alltests',
'--fork=HomesteadToEIP150At5 --verify-test-amount-alltests',
'--fork=BerlinToLondonAt5 --verify-test-amount-alltests',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:blockchain -- ${{ matrix.args }}
vm-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run build:benchmarks
working-directory: ${{ env.cwd }}
- run: npm run benchmarks -- mainnetBlocks:10 | tee output.txt
working-directory: ${{ env.cwd }}
# Run git stash in case github-action-benchmark has trouble switching to gh-pages branch due to differing package-locks
- run: git stash
- name: Compare benchmarks
uses: rhysd/github-action-benchmark@v1
with:
tool: 'benchmarkjs'
# Where the output from the benchmark tool is stored
output-file-path: ${{ env.cwd }}/output.txt
# Location of data in gh-pages branch
benchmark-data-dir-path: dev/bench/vm
# Enable alert commit comment (default alert threshold: 200%)
comment-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy to GitHub pages branch automatically (if on master)
auto-push: 'false'
# Re-apply git stash to prepare for saving back to cache.
# Avoids exit code 1 by checking if there are changes to be stashed first
- run: STASH_LIST=`git stash list` && [ ! -z $STASH_LIST ] && git stash apply || echo "No files to stash-apply. Skipping…"