-
Notifications
You must be signed in to change notification settings - Fork 2.1k
229 lines (181 loc) · 8.4 KB
/
ci-zk-toolbox-reusable.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
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Workflow template for CI jobs for Core Components
on:
workflow_call:
env:
CLICOLOR: 1
jobs:
lint:
name: lint
uses: ./.github/workflows/ci-core-lint-reusable.yml
tests:
runs-on: [ matterlabs-ci-runner ]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
submodules: "recursive"
fetch-depth: 0
- name: Setup environment
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo IN_DOCKER=1 >> .env
- name: Start services
run: |
ci_localnet_up
ci_run sccache --start-server
- name: Build zk_toolbox
run: ci_run bash -c "./bin/zkt"
- name: Initialize ecosystem
run: |
ci_run git config --global --add safe.directory /usr/src/zksync
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
ci_run zk_inception ecosystem init --deploy-paymaster --deploy-erc20 \
--deploy-ecosystem --l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_era \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_era \
--ignore-prerequisites --verbose \
--observability=false
- name: Create and initialize Validium chain
run: |
ci_run zk_inception chain create \
--chain-name chain_validium \
--chain-id sequential \
--prover-mode no-proofs \
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode validium \
--base-token-address 0x0000000000000000000000000000000000000001 \
--base-token-price-nominator 1 \
--base-token-price-denominator 1 \
--set-as-default false \
--ignore-prerequisites
ci_run zk_inception chain init \
--deploy-paymaster \
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_validium \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_validium \
--port-offset 2000 \
--chain chain_validium
- name: Build test dependencies
run: |
ci_run zk_supervisor test build
- name: Run servers
run: |
ci_run zk_inception server --ignore-prerequisites --chain era &> server_rollup.log &
ci_run zk_inception server --ignore-prerequisites --chain chain_validium &> server_validium.log &
ci_run sleep 5
- name: Run integration tests
run: |
ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain era &> integration_rollup.log &
PID1=$!
ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain chain_validium &> integration_validium.log &
PID2=$!
wait $PID1
wait $PID2
- name: Init external nodes
run: |
ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era
ci_run zk_inception external-node init --ignore-prerequisites --chain era
ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain chain_validium
ci_run zk_inception external-node init --ignore-prerequisites --chain chain_validium
- name: Run recovery tests (from snapshot)
run: |
ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain era &> recovery_snap_rollup.log &
PID1=$!
ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain chain_validium &> recovery_snap_validium.log &
PID2=$!
wait $PID1
wait $PID2
- name: Run recovery tests (from genesis)
run: |
ci_run zk_supervisor test recovery --no-deps --ignore-prerequisites --verbose --chain era &> recovery_gen_rollup.log &
PID1=$!
ci_run zk_supervisor test recovery --no-deps --ignore-prerequisites --verbose --chain chain_validium &> recovery_gen_validium.log &
PID2=$!
wait $PID1
wait $PID2
- name: Run external node server
run: |
ci_run zk_inception external-node run --ignore-prerequisites --chain era &> external_node_rollup.log &
ci_run zk_inception external-node run --ignore-prerequisites --chain chain_validium &> external_node_validium.log &
ci_run sleep 5
- name: Run integration tests en
run: |
ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain era &> integration_en_rollup.log &
PID1=$!
ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain chain_validium &> integration_en_validium.log &
PID2=$!
wait $PID1
wait $PID2
- name: Run revert tests (external node)
run: |
ci_run zk_supervisor test revert --no-deps --external-node --ignore-prerequisites --chain chain_validium &> revert_validium.log
# PID2=$!
ci_run zk_supervisor test revert --no-deps --ignore-prerequisites --chain era &> revert_rollup.log
# PID1=$!
# wait $PID1
# wait $PID2
# Upgrade tests should run last, because as soon as they
# finish the bootloader will be different
# TODO make upgrade tests safe to run multiple times
- name: Run upgrade test
run: |
ci_run zk_supervisor test upgrade --no-deps --chain era
- name: Show server_rollup.log logs
if: always()
run: ci_run cat server_rollup.log || true
- name: Show server_validium.log logs
if: always()
run: ci_run cat server_validium.log || true
- name: Show external_node_rollup.log logs
if: always()
run: ci_run cat external_node_rollup.log || true
- name: Show external_node_validium.log logs
if: always()
run: ci_run cat external_node_validium.log || true
- name: Show integration_rollup.log logs
if: always()
run: ci_run cat integration_rollup.log || true
- name: Show integration_validium.log logs
if: always()
run: ci_run cat integration_validium.log || true
- name: Show recovery_snap_rollup.log logs
if: always()
run: ci_run cat recovery_snap_rollup.log || true
- name: Show recovery_snap_validium.log logs
if: always()
run: ci_run cat recovery_snap_validium.log || true
- name: Show recovery_gen_rollup.log logs
if: always()
run: ci_run cat recovery_gen_rollup.log || true
- name: Show recovery_gen_validium.log logs
if: always()
run: ci_run cat recovery_gen_validium.log || true
- name: Show integration_en_rollup.log logs
if: always()
run: ci_run cat integration_en_rollup.log || true
- name: Show integration_en_validium.log logs
if: always()
run: ci_run cat integration_en_validium.log || true
- name: Show revert_rollup.log logs
if: always()
run: ci_run cat revert_rollup.log || true
- name: Show revert_validium.log logs
if: always()
run: ci_run cat revert_validium.log || true
- name: Show revert_main.log logs
if: always()
run: |
ci_run cat core/tests/revert-test/era_revert_main.log || true
ci_run cat core/tests/revert-test/chain_validium_revert_main.log || true
- name: Show revert_ext.log logs
if: always()
run: |
ci_run cat core/tests/revert-test/era_revert_ext.log || true
ci_run cat core/tests/revert-test/chain_validium_revert_ext.log || true