-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (99 loc) · 3.42 KB
/
Copy pathexercise.yml
File metadata and controls
113 lines (99 loc) · 3.42 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
---
name: Chain Exercise Suite
# Runs `quantus exercise` against a freshly built fast-governance dev node.
# Nightly + manual for now: building the node from the chain repo dominates
# the runtime, and QPoW block times make a full run take tens of minutes.
on:
schedule:
- cron: "0 2 * * *" # nightly at 02:00 UTC
workflow_dispatch:
inputs:
chain_ref:
description: "Git ref of Quantus-Network/chain to build the node from"
required: false
default: "main"
fuzz_iterations:
description: "Number of seeded fuzz iterations"
required: false
default: "25"
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CARGO_NET_RETRY: 10
CARGO_NET_TIMEOUT: 60
jobs:
exercise:
name: 🏋️ Exercise Suite (fast-governance dev node)
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout quantus-cli
uses: actions/checkout@v5
- name: Checkout chain
uses: actions/checkout@v5
with:
repository: Quantus-Network/chain
ref: ${{ github.event.inputs.chain_ref || 'main' }}
path: chain
- uses: ./.github/actions/ubuntu
- name: Cache cargo registry & CLI target
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-exercise-cli-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
restore-keys: |
${{ runner.os }}-cargo-exercise-cli-
- name: Cache chain target
uses: actions/cache@v5
with:
path: chain/target
key: ${{ runner.os }}-cargo-exercise-node-${{ hashFiles('chain/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-exercise-node-
- name: Build quantus-node (fast-governance)
working-directory: chain
run: cargo build --release -p quantus-node --features quantus-runtime/fast-governance
- name: Build quantus-cli
run: SKIP_CIRCUIT_BUILD=1 cargo build --release --locked
- name: Start dev node
run: |
nohup chain/target/release/quantus-node --dev \
--base-path /tmp/quantus-exercise-dev \
> /tmp/quantus-node.log 2>&1 &
echo "NODE_PID=$!" >> "$GITHUB_ENV"
# Wait for RPC to answer (mining warm-up can take a while).
for i in $(seq 1 60); do
if curl -sf -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"system_health","params":[]}' \
http://127.0.0.1:9944 > /dev/null; then
echo "RPC up after ${i}s"
exit 0
fi
sleep 1
done
echo "node RPC never came up" >&2
tail -50 /tmp/quantus-node.log >&2
exit 1
- name: Run exercise suite
run: |
./target/release/quantus exercise \
--json \
--fuzz-iterations "${{ github.event.inputs.fuzz_iterations || '25' }}" \
| tee exercise-report.txt
- name: Upload report and node log
if: always()
uses: actions/upload-artifact@v4
with:
name: exercise-report
path: |
exercise-report.txt
/tmp/quantus-node.log
if-no-files-found: ignore
- name: Stop dev node
if: always()
run: kill "$NODE_PID" 2>/dev/null || true