-
Notifications
You must be signed in to change notification settings - Fork 1
388 lines (290 loc) · 16.2 KB
/
test.yaml
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
name: "test"
on:
push:
branches: [main]
pull_request:
branches: [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@v4
- name: Maximize build space
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"
- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.24.6/install
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: holochain-wind-tunnel
authToken: ${{ secrets.CACHIX_HOLOCHAIN_WIND_TUNNEL }}
- uses: Swatinem/rust-cache@v2
- name: Check scripts
run: |
nix develop .#ci -c bash -c "shellcheck scripts/*.sh"
- name: Check TOML formatting
run: |
nix develop .#ci -c bash -c "./scripts/format-toml.sh --check"
- name: Check YAML formatting
run: |
nix develop .#ci -c bash -c "./scripts/format-yaml.sh -lint"
- name: Check Nix formatting
run: |
nix develop .#ci -c bash -c "source ./scripts/checks.sh && check_nix_fmt"
- name: Lint Nix
run: |
nix develop .#ci -c bash -c "source ./scripts/checks.sh && check_nix_static"
- name: Check Rust formatting
run: |
nix develop .#ci -c bash -c "source ./scripts/checks.sh && check_rust_fmt"
- name: Build and unit tests
run: |
nix build .#workspace
- name: Lint Rust
run: |
# Currently the only check is clippy, could bundle the other checks into the flake and remove the steps above?
nix flake check --all-systems
- name: Smoke test - zome_call_single_value
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - single_write_many_read
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - dht_sync_lag
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - dht_sync_lag with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - app_install
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#app_install -- --connection-string ws://localhost:8888 --agents 2 --behaviour minimal:1 --behaviour large:1 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - first_call
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#first_call -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_read
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_read with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# wait for the CHC service to be available
sleep 2
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_query
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_query -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_query with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_query -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - local_signals
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#local_signals -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_validated
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_validated -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_validated with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_validated -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - trycp_write_validated
run: |
set -x
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#trycp_write_validated -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - trycp_write_validated with CHC enabled
run: |
set -x
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 10 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" CHC_ENABLED="1" MIN_PEERS=2 nix run .#trycp_write_validated -- --targets targets-ci.yaml --instances-per-target 2 --duration 10 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - remote_call_rate
run: |
set -x
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_call_rate -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - two_party_countersigning
run: |
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#two_party_countersigning -- --targets targets-ci.yaml --behaviour initiate:1 --behaviour participate:1 --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - two_party_countersigning with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 10 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" CHC_ENABLED="1" MIN_PEERS=2 nix run .#two_party_countersigning -- --targets targets-ci.yaml --behaviour initiate:1 --behaviour participate:1 --instances-per-target 2 --duration 10 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - validation_receipts
run: |
set -x
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#validation_receipts -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - remote_signals
run: |
set -x
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_signals -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Smoke test - validation_receipts with CHC enabled
run: |
set -x
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 10 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" CHC_ENABLED="1" MIN_PEERS=2 nix run .#validation_receipts -- --targets targets-ci.yaml --instances-per-target 2 --duration 10 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
- name: Build scenario bundles
if: runner.os == 'Linux'
run: |
set -euxo pipefail
scenario_names() {
find scenarios/ -mindepth 1 -maxdepth 1 -type d -printf "%f\n"
}
# Disable sandbox because hApp builds aren't done by Nix and need network access.
scenario_names | xargs -I % nix bundle --option sandbox false .#packages.x86_64-linux.%
mkdir -p dist
scenario_names | xargs -I % cp %-arx dist/%
- name: Archive scenario bundles
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: scenario-bundles
if-no-files-found: error
path: dist/*