-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (70 loc) · 3.12 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
name: "test"
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v25
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 Nix formatting
run: |
nix fmt ./nix flake.nix -- --check
- name: Lint Nix
run: |
nix develop --command bash -c "statix check ./nix && statix check ./flake.nix"
- name: Check Rust formatting
run: |
nix develop --command bash -c "cargo fmt --all -- --check"
- name: Lint Rust
run: |
nix develop --command bash -c "cargo clippy --workspace --all-targets --all-features -- -D warnings"
- name: Unit tests
run: |
nix develop --command bash -c "cargo test"
- 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 &"
# Run the scenario for 5 seconds
nix develop --command bash -c "RUST_LOG=info cargo run --package zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress --no-metrics"
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 --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
nix develop --command bash -c "RUST_LOG=info cargo run --package single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress --no-metrics"
pkill hc
pkill holochain
pkill lair-keystore
# Failed on CI with ` error: linking with `cc` failed: exit status: 1`
# - 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
# nix develop --command bash -c "RUST_LOG=info cargo run --package dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress --no-metrics"
#
# pkill hc
# pkill holochain
# pkill lair-keystore
- name: Check scripts
run: |
nix develop --command bash -c "shellcheck scripts/*.sh"