-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (125 loc) · 6.58 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
name: "test"
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
merge_group:
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Maximize build space
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@v26
with:
install_url: https://releases.nixos.org/nix/nix-2.20.4/install
extra_nix_config: |
experimental-features = flakes nix-command
- uses: cachix/cachix-action@v14
with:
name: holochain-wind-tunnel
extraPullNames: holochain-ci
authToken: ${{ secrets.CACHIX_HOLOCHAIN_WIND_TUNNEL }}
- name: Check scripts
run: |
nix develop --command bash -c "shellcheck scripts/*.sh"
- name: Check Nix formatting
run: |
nix develop .#ci --command bash -c "source ./scripts/checks.sh && check_nix_fmt"
- name: Lint Nix
run: |
nix develop .#ci --command bash -c "source ./scripts/checks.sh && check_nix_static"
- name: Check Rust formatting
run: |
nix develop .#ci --command 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
- name: Smoke test - zome_call_single_value
run: |
# Start a sandbox conductor and run it in the background
nix develop --command bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# TODO using `localhost` is resolving to an IPv6 address, but why is that giving a connection refused?
# 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - single_write_many_read
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - dht_sync_lag
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - app_install
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - first_call
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --agents 1 --behaviour local:1 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - write_read
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - write_query
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Smoke test - local_signals
run: |
# Start a sandbox conductor and run it in the background
nix develop --command 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 --echo hc && pkill --echo holochain && pkill --echo lair-keystore
- name: Build scenario bundles
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 % dist/
- name: Archive scenario bundles
uses: actions/upload-artifact@v4
with:
name: scenario-bundles
if-no-files-found: error
path: dist/*