forked from sigp/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 2
275 lines (235 loc) · 8.79 KB
/
local-testnet.yml
File metadata and controls
275 lines (235 loc) · 8.79 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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# Test that local testnet starts successfully.
name: local testnet
on:
push:
branches:
- unstable
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dockerfile-ubuntu:
runs-on: ${{ github.repository == 'sigp/lighthouse' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
- name: Build Docker image
run: |
docker build --build-arg FEATURES=portable,spec-minimal -t lighthouse:local .
docker save lighthouse:local -o lighthouse-docker.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: lighthouse-docker
path: lighthouse-docker.tar
retention-days: 3
run-local-testnet:
runs-on: ${{ github.repository == 'sigp/lighthouse' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
needs: dockerfile-ubuntu
steps:
- uses: actions/checkout@v5
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Start local testnet with Assertoor
run: ./start_local_testnet.sh -e local-assertoor -c -a -b false && sleep 60
working-directory: scripts/local_testnet
- name: Await Assertoor test result
id: assertoor_test_result
uses: ethpandaops/assertoor-github-action@v1
with:
kurtosis_enclave_name: local-assertoor
- name: Stop local testnet and dump logs
run: ./stop_local_testnet.sh local-assertoor
working-directory: scripts/local_testnet
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-local-testnet
path: |
scripts/local_testnet/logs
retention-days: 3
- name: Return Assertoor test result
shell: bash
run: |
test_result="${{ steps.assertoor_test_result.outputs.result }}"
test_status=$(
cat <<"EOF"
${{ steps.assertoor_test_result.outputs.test_overview }}
EOF
)
failed_test_status=$(
cat <<"EOF"
${{ steps.assertoor_test_result.outputs.failed_test_details }}
EOF
)
echo "Test Result: $test_result"
echo "$test_status"
if ! [ "$test_result" == "success" ]; then
echo "Failed Test Task Status:"
echo "$failed_test_status"
exit 1
fi
doppelganger-protection-success-test:
needs: dockerfile-ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Run the doppelganger protection success test script
run: |
./doppelganger_protection.sh success
working-directory: scripts/tests
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-doppelganger-protection-success
path: |
scripts/local_testnet/logs
retention-days: 3
doppelganger-protection-failure-test:
needs: dockerfile-ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Run the doppelganger protection failure test script
run: |
./doppelganger_protection.sh failure
working-directory: scripts/tests
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-doppelganger-protection-failure
path: |
scripts/local_testnet/logs
retention-days: 3
# Tests checkpoint syncing to a live network (current fork) and a running devnet (usually next scheduled fork)
checkpoint-sync-test:
name: checkpoint-sync-test-${{ matrix.network }}
runs-on: ${{ github.repository == 'sigp/lighthouse' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
needs: dockerfile-ubuntu
if: contains(github.event.pull_request.labels.*.name, 'syncing')
continue-on-error: true
strategy:
matrix:
network: [sepolia]
steps:
- uses: actions/checkout@v5
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Run the checkpoint sync test script
run: |
./checkpoint-sync.sh "sync-${{ matrix.network }}" "checkpoint-sync-config-${{ matrix.network }}.yaml"
working-directory: scripts/tests
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-checkpoint-sync-${{ matrix.network }}
path: |
scripts/local_testnet/logs
retention-days: 3
# Test syncing from genesis on a local testnet. Aims to cover forward syncing both short and long distances.
genesis-sync-test:
name: genesis-sync-test-${{ matrix.fork }}-${{ matrix.offline_secs }}s
runs-on: ${{ github.repository == 'sigp/lighthouse' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
needs: dockerfile-ubuntu
strategy:
matrix:
fork: [electra, fulu]
offline_secs: [120, 300]
steps:
- uses: actions/checkout@v5
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Run the genesis sync test script
run: |
./genesis-sync.sh "sync-${{ matrix.fork }}-${{ matrix.offline_secs }}s" "genesis-sync-config-${{ matrix.fork }}.yaml" "${{ matrix.fork }}" "${{ matrix.offline_secs }}"
working-directory: scripts/tests
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-genesis-sync-${{ matrix.fork }}-${{ matrix.offline_secs }}s
path: |
scripts/local_testnet/logs
retention-days: 3
# This job succeeds ONLY IF all others succeed. It is used by the merge queue to determine whether
# a PR is safe to merge. New jobs should be added here.
local-testnet-success:
name: local-testnet-success
runs-on: ${{ github.repository == 'sigp/lighthouse' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
needs: [
'dockerfile-ubuntu',
'run-local-testnet',
'doppelganger-protection-success-test',
'doppelganger-protection-failure-test',
'genesis-sync-test'
]
steps:
- uses: actions/checkout@v5
- name: Check that success job is dependent on all others
run: |
exclude_jobs='checkpoint-sync-test'
./scripts/ci/check-success-job.sh ./.github/workflows/local-testnet.yml local-testnet-success "$exclude_jobs"