-
Notifications
You must be signed in to change notification settings - Fork 2
425 lines (332 loc) · 13.6 KB
/
test.yaml
File metadata and controls
425 lines (332 loc) · 13.6 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
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
name: "test"
on:
push:
branches:
- main
- main-*
pull_request:
branches:
- main
- main-*
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Maximize build space
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v5
with:
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"
- name: Install nix
uses: cachix/install-nix-action@v31
with:
install_url: https://releases.nixos.org/nix/nix-2.28.3/install
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v16
with:
name: holochain-ci
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
# Additional key to ensure that cache is invalidated when flake lock updated
key: ${{ hashFiles('flake.lock') }}
# We do a custom build of Holochain in the CI shell which can take up a lot of
# disk space. We want to build and cache this early in the workflow so that if we
# do run out of disk space, then at least we've captured that big piece in the
# cache and can just download it next time.
- name: Cache CI shell
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
nix develop --profile ci-profile -c true
cachix push holochain-ci ci-profile
echo "==> Available space after step"
echo
df -h
- name: Check formatting
run: |
nix flake check --all-systems
echo "==> Available space after step"
echo
df -h
- name: Verify go cli tool
run: |
nix run .#check-go
echo "==> Available space after step"
echo
df -h
- name: Lint Rust
run: |
nix develop -c bash -c "source scripts/checks.sh && check_rust_static"
echo "==> Available space after step"
echo
df -h
- name: Run unit tests
run: |
nix develop -c bash -c "cargo test --workspace --all-targets"
echo "==> Available space after step"
echo
df -h
- name: Validate Nomad jobs
env:
NIXPKGS_ALLOW_UNFREE: 1 # Required to run nomad
NOMAD_VAR_scenario_url: "https://example.com" # Dummy URL for validation
run: |
nix run .#validate-all-nomad-jobs
echo "==> Available space after step"
echo
df -h
- name: Test influx scripts
env:
WIND_TUNNEL_SKIP_CLEAN_PROMPT: 1
run: |
nix run .#check-influx-setup-script
echo "==> Available space after step"
echo
df -h
- name: Smoke test - zome_call_single_value
run: |
nix run .#rust-smoke-test -- --package zome_call_single_value -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - single_write_many_read
run: |
nix run .#rust-smoke-test -- --package single_write_many_read -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - dht_sync_lag
run: |
nix run .#rust-smoke-test -- --package dht_sync_lag -- --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - app_install
run: |
nix run .#rust-smoke-test -- --package app_install -- --agents 2 --behaviour minimal:1 --behaviour large:1 --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - first_call
run: |
nix run .#rust-smoke-test -- --package first_call -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_read
run: |
nix run .#rust-smoke-test -- --package write_read -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_query
run: |
nix run .#rust-smoke-test -- --package write_query -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - local_signals
run: |
nix run .#rust-smoke-test -- --package local_signals -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_validated
run: |
nix run .#rust-smoke-test -- --package write_validated -- --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - remote_call_rate
run: |
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package remote_call_rate -- --agents 2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - validation_receipts
run: |
set -x
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package validation_receipts -- --duration 45 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - remote_signals
run: |
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package remote_signals -- --agents 2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - kitsune_continuous_flow
run: |
set -x
kitsune_host="127.0.0.1:30000"
# Start local bootstrap and relay server
nix develop .#kitsune -c bash -c "kitsune2-bootstrap-srv --no-sbd --listen $kitsune_host &"
# Run the scenario
nix run .#rust-smoke-test -- --package kitsune_continuous_flow -- --bootstrap-server-url "http://$kitsune_host" --relay-url "http://$kitsune_host" --duration 15 --agents 2
# Stop servers
pkill -f kitsune2-bootstrap-srv || true
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_get_agent_activity
run: |
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package write_get_agent_activity -- --agents 2 --behaviour write:1 --behaviour get_agent_activity:1 --duration 5 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_get_agent_activity_volatile
run: |
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package write_get_agent_activity_volatile -- --agents 2 --behaviour write:1 --behaviour get_agent_activity_volatile:1 --duration 60 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - write_validated_must_get_agent_activity
run: |
# Run the scenario
MIN_AGENTS=2 nix run .#rust-smoke-test -- --package write_validated_must_get_agent_activity -- --agents 2 --behaviour write:1 --behaviour must_get_agent_activity:1 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - zero_arc_create_data
run: |
nix run .#rust-smoke-test -- --package zero_arc_create_data -- --agents 3 --behaviour zero:1 --behaviour full:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - zero_arc_create_data_validated
run: |
nix run .#rust-smoke-test -- --package zero_arc_create_data_validated -- --agents 3 --behaviour zero:1 --behaviour full:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - zero_arc_create_and_read
run: |
nix run .#rust-smoke-test -- --package zero_arc_create_and_read -- --agents 4 --behaviour zero_read:1 --behaviour zero_write:1 --behaviour full:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - full_arc_create_validated_zero_arc_read
run: |
nix run .#rust-smoke-test -- --package full_arc_create_validated_zero_arc_read -- --agents 3 --behaviour zero:1 --behaviour full:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - mixed_arc_get_agent_activity
run: |
nix run .#rust-smoke-test -- --package mixed_arc_get_agent_activity -- --agents 5 --behaviour zero_read:2 --behaviour zero_write:1 --behaviour full_write:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - mixed_arc_must_get_agent_activity
run: |
nix run .#rust-smoke-test -- --package mixed_arc_must_get_agent_activity -- --agents 5 --behaviour zero_must_get_agent_activity:2 --behaviour zero_write:1 --behaviour full_write:2 --duration 30 --no-progress
echo "==> Available space after step"
echo
df -h
- name: Smoke test - unyt_chain_transaction
run: |
# Start a local Durable Objects store.
# Need to re-direct stdin otherwise the wrangler terminates when running in background.
nix run .#local-durable-objects </dev/null >local-durable-objects.log 2>&1 &
# Run the scenario
nix run .#rust-smoke-test -- --package unyt_chain_transaction -- --agents 5 --behaviour initiate:1 --behaviour spend:2 --behaviour smart_agreements:2 --duration 30 --no-progress
# Print the logs from the local Durable Objects store
cat local-durable-objects.log
# Kill the local Durable Objects store process.
# Need to kill wrangler as killing the background process leaves wrangler orphaned.
pkill -f wrangler
echo "==> Available space after step"
echo
df -h
- name: Smoke test - unyt_chain_transaction_zero_arc
run: |
# Start a local Durable Objects store.
# Need to re-direct stdin otherwise the wrangler terminates when running in background.
nix run .#local-durable-objects </dev/null >local-durable-objects.log 2>&1 &
# Run the scenario
nix run .#rust-smoke-test -- --package unyt_chain_transaction_zero_arc -- --agents 5 --behaviour initiate:1 --behaviour zero_spend:1 --behaviour zero_smart_agreements:1 --behaviour full_observer:2 --duration 30 --no-progress
# Print the logs from the local Durable Objects store
cat local-durable-objects.log
# Kill the local Durable Objects store process.
# Need to kill wrangler as killing the background process leaves wrangler orphaned.
pkill -f wrangler
echo "==> Available space after step"
echo
df -h
- name: Smoke test - scenario summary HTML visualiser
run: |
nix run .#summary-visualiser-smoke-test
archive_bundles:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Check if nix files changed
id: filter
uses: tj-actions/changed-files@v47
with:
files: |
**/*.nix
flake.lock
- name: Maximize build space
if: runner.os == 'Linux' && steps.filter.outputs.any_changed == 'true'
uses: AdityaGarg8/remove-unwanted-software@v5
with:
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"
- name: Install nix
if: steps.filter.outputs.any_changed == 'true'
uses: cachix/install-nix-action@v31
with:
install_url: https://releases.nixos.org/nix/nix-2.28.3/install
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v16
if: steps.filter.outputs.any_changed == 'true'
with:
name: holochain-ci
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build scenarios
if: runner.os == 'Linux' && steps.filter.outputs.any_changed == 'true'
run: |
set -euxo pipefail
scenario_names() {
find scenarios/ -mindepth 1 -maxdepth 1 -type d -printf "%f\n"
}
scenario_names | xargs -I % nix build .#packages.x86_64-linux.%
echo "==> Available space after step"
echo
df -h
changelog-preview-comment:
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'hra-release') && github.actor != 'dependabot[bot]'
name: Add comment of changelog preview
uses: holochain/actions/.github/workflows/changelog-preview-comment.yml@v1.6.0
ci_pass:
if: ${{ always() }}
runs-on: "ubuntu-latest"
needs:
- test
- archive_bundles
steps:
- name: check status
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}