-
Notifications
You must be signed in to change notification settings - Fork 209
366 lines (342 loc) · 11.5 KB
/
test.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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
name: "Arweave Tests"
on:
workflow_dispatch:
push:
branches: ["**"]
pull_request_target:
types: [opened]
branches:
- 'master'
- 'release/**'
- 'releases/**'
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
# only arweave dependencies are being cached,
# those are not updated everyday and this is
# unecessary to fetch them everytime.
- uses: actions/cache@v4
id: cache
with:
path: |
_build/default/lib/accept
_build/default/lib/b64fast
_build/default/lib/cowboy
_build/default/lib/cowlib
_build/default/lib/graphql
_build/default/lib/gun
_build/default/lib/jiffy
_build/default/lib/prometheus
_build/default/lib/prometheus_cowboy
_build/default/lib/prometheus_httpd
_build/default/lib/prometheus_process_collector
_build/default/lib/quantile_estimator
_build/default/lib/ranch
_build/default/lib/.rebar3
_build/default/lib/recon
_build/default/lib/rocksdb
_build/default/plugins/
_build/default/plugins/aleppo
_build/default/plugins/geas
_build/default/plugins/geas_rebar3
_build/default/plugins/hex_core
_build/default/plugins/katana_code
_build/default/plugins/pc
_build/default/plugins/.rebar3
_build/default/plugins/rebar3_archive_plugin
_build/default/plugins/rebar3_elvis_plugin
_build/default/plugins/rebar3_hex
_build/default/plugins/samovar
_build/default/plugins/verl
_build/default/plugins/zipper
key: deps-cache-${{ hashFiles('rebar.lock') }}
restore-keys: |
deps-cache-${{ hashFiles('rebar.lock') }}
- name: Get dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: ./ar-rebar3 test get-deps
- uses: actions/cache@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
_build/default/lib/accept
_build/default/lib/b64fast
_build/default/lib/cowboy
_build/default/lib/cowlib
_build/default/lib/graphql
_build/default/lib/gun
_build/default/lib/jiffy
_build/default/lib/prometheus
_build/default/lib/prometheus_cowboy
_build/default/lib/prometheus_httpd
_build/default/lib/prometheus_process_collector
_build/default/lib/quantile_estimator
_build/default/lib/ranch
_build/default/lib/.rebar3
_build/default/lib/recon
_build/default/lib/rocksdb
_build/default/plugins/
_build/default/plugins/aleppo
_build/default/plugins/geas
_build/default/plugins/geas_rebar3
_build/default/plugins/hex_core
_build/default/plugins/katana_code
_build/default/plugins/pc
_build/default/plugins/.rebar3
_build/default/plugins/rebar3_archive_plugin
_build/default/plugins/rebar3_elvis_plugin
_build/default/plugins/rebar3_hex
_build/default/plugins/samovar
_build/default/plugins/verl
_build/default/plugins/zipper
key: deps-cache-${{ hashFiles('rebar.lock') }}
- name: Build arweave test sources
run: ./ar-rebar3 test compile
# some artifacts are compiled and only available
# in arweave directy (libraries)
- name: Prepare artifacts
run: |
chmod -R u+w ./_build
tar czfp _build.tar.gz ./_build
tar czfp apps.tar.gz ./apps
# to avoid reusing artifacts from someone else
# and generating issues, an unique artifact is
# produced using github checksum.
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}
if-no-files-found: error
retention-days: 1
overwrite: true
path: |
_build.tar.gz
apps.tar.gz
# some artifacts are compiled and only available
# in arweave directy (libraries)
- name: Prepare artifacts
run: |
chmod -R u+w ./_build
tar czfp _build.tar.gz ./_build
tar czfp apps.tar.gz ./apps
# to avoid reusing artifacts from someone else
# and generating issues, an unique artifact is
# produced using github checksum.
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}
if-no-files-found: error
include-hidden-files: true
retention-days: 7
overwrite: true
path: |
_build.tar.gz
apps.tar.gz
####################################################################
# Long-running tests. Put these first to limit the overall runtime
# of the test suite
####################################################################
eunit-tests-long-running:
needs: build
runs-on: self-hosted
strategy:
max-parallel: 4
matrix:
core_test_mod: [
## Long-running tests. Put these first to limit the overall runtime of the
## test suite
ar_coordinated_mining_tests,
ar_data_sync_tests,
ar_fork_recovery_tests,
ar_multiple_txs_per_wallet_tests,
ar_packing_tests,
ar_poa,
ar_vdf_server_tests,
ar_post_block_tests,
ar_reject_chunks_tests
]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-${{ github.sha }}
# Both artifacts (_build and apps dir) are
# required.
- name: Extract artifact
run: |
tar zxfp _build.tar.gz
tar zxfp apps.tar.gz
- name: ${{ matrix.core_test_mod }}.erl
id: tests
run: bash scripts/github_workflow.sh "${{ matrix.core_test_mod }}"
# this part of the job produces test artifacts from logs
# generated by the tests. It also collect dumps and the files
# present in .tmp (temporary arweave data store)
- name: upload artifacts in case of failure
uses: actions/upload-artifact@v4
if: always() && failure()
with:
name: "logs-${{ matrix.core_test_mod }}-${{ github.run_attempt }}-${{ job.status }}-${{ runner.name }}-${{ github.sha }}"
retention-days: 7
overwrite: true
include-hidden-files: true
path: |
./logs
*.out
*.dump
####################################################################
# Modules containing tests
####################################################################
eunit-tests-modules:
needs: build
runs-on: self-hosted
strategy:
max-parallel: 4
matrix:
core_test_mod: [
ar,
ar_block,
ar_block_cache,
ar_chain_stats,
ar_chunk_storage,
ar_data_sync_worker_master,
ar_deep_hash,
ar_diff_dag,
ar_ets_intervals,
ar_events,
ar_inflation,
ar_intervals,
ar_join,
ar_kv,
ar_merkle,
ar_mining_server,
ar_mining_stats,
ar_node,
ar_node_utils,
ar_nonce_limiter,
# ar_p3,
# ar_p3_config,
# ar_p3_db,
ar_packing_server,
ar_patricia_tree,
ar_peers,
ar_pricing,
ar_replica_2_9,
ar_retarget,
ar_serialize,
ar_storage_module,
ar_storage,
ar_sync_buckets,
ar_sync_record,
ar_tx,
ar_tx_db,
ar_unbalanced_merkle,
ar_util,
ar_verify_chunks,
ar_wallet,
ar_webhook,
ar_pool
]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-${{ github.sha }}
# Both artifacts (_build and apps dir) are
# required.
- name: Extract artifact
run: |
tar zxfp _build.tar.gz
tar zxfp apps.tar.gz
- name: ${{ matrix.core_test_mod }}.erl
id: tests
run: bash scripts/github_workflow.sh "${{ matrix.core_test_mod }}"
# this part of the job produces test artifacts from logs
# generated by the tests. It also collect dumps and the files
# present in .tmp (temporary arweave data store)
- name: upload artifacts in case of failure
uses: actions/upload-artifact@v4
if: always() && failure()
with:
name: "logs-${{ matrix.core_test_mod }}-${{ github.run_attempt }}-${{ job.status }}-${{ runner.name }}-${{ github.sha }}"
retention-days: 7
overwrite: true
include-hidden-files: true
path: |
./logs
*.out
*.dump
####################################################################
# Test modules (note: that _tests are implicitly run by a matching
# prefix name
####################################################################
eunit-tests-suite:
needs: build
runs-on: self-hosted
strategy:
max-parallel: 4
matrix:
core_test_mod: [
ar_base64_compatibility_tests,
ar_config_tests,
ar_difficulty_tests,
ar_header_sync_tests,
ar_http_iface_tests,
ar_http_util_tests,
ar_info_tests,
ar_mempool_tests,
ar_mine_randomx_tests,
ar_mine_vdf_tests,
ar_mining_io_tests,
ar_poller_tests,
ar_reject_chunks_tests,
ar_replica_2_9_nif_tests,
ar_semaphore_tests,
ar_start_from_block_tests,
ar_tx_blacklist_tests,
ar_tx_replay_pool_tests,
ar_vdf_tests,
]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-${{ github.sha }}
# Both artifacts (_build and apps dir) are
# required.
- name: Extract artifact
run: |
tar zxfp _build.tar.gz
tar zxfp apps.tar.gz
- name: ${{ matrix.core_test_mod }}.erl
id: tests
run: bash scripts/github_workflow.sh "${{ matrix.core_test_mod }}"
# this part of the job produces test artifacts from logs
# generated by the tests. It also collect dumps and the files
# present in .tmp (temporary arweave data store)
- name: upload artifacts in case of failure
uses: actions/upload-artifact@v4
if: always() && failure()
with:
name: "logs-${{ matrix.core_test_mod }}-${{ github.run_attempt }}-${{ job.status }}-${{ runner.name }}-${{ github.sha }}"
retention-days: 7
overwrite: true
include-hidden-files: true
path: |
./logs
*.out
*.dump