-
Notifications
You must be signed in to change notification settings - Fork 39
138 lines (124 loc) · 4.58 KB
/
axon-start-test.yml
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
name: Axon start test
on:
push:
pull_request:
merge_group:
workflow_dispatch:
jobs:
# Start a single Axon node
single-node:
strategy:
matrix:
# Supported GitHub-hosted runners and hardware resources
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
os: [ubuntu-22.04]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
- name: Build Axon in the development profile
run: |
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
# related issue: https://github.com/axonweb3/axon/issues/1387
lscpu
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
PORTABLE=1 USE_SSE=1 cargo build
- name: Start a single Axon node
env:
LOG_FILE: ${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log
run: |
target/debug/axon --version | tee ${{ env.LOG_FILE }}
target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
| tee -a ${{ env.LOG_FILE }}
target/debug/axon run \
--config devtools/chain/config.toml \
| tee -a ${{ env.LOG_FILE }} &
npx zx <<'EOF'
import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js'
await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2))
EOF
timeout-minutes: 1
- name: Archive logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: single-axon-node-logs
path: |
${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log
multi-nodes:
strategy:
matrix:
# Supported GitHub-hosted runners and hardware resources
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
os: [ubuntu-22.04]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
- name: Build Axon in the development profile
run: |
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
# related issue: https://github.com/axonweb3/axon/issues/1387
lscpu
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
PORTABLE=1 USE_SSE=1 cargo build
- name: Start multiple Axon nodes
env:
LOG_PATH: ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes
run: |
mkdir -p ${{ env.LOG_PATH }}
target/debug/axon --version
for id in 1 2 3 4; do
target/debug/axon init \
--config devtools/chain/nodes/node_${id}.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
> ${{ env.LOG_PATH }}/node_${id}.log
done
for id in 1 2 3 4; do
target/debug/axon run \
--config devtools/chain/nodes/node_${id}.toml \
>> ${{ env.LOG_PATH }}/node_${id}.log &
done
npx zx <<'EOF'
import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js'
await retry(3, '6s', () => Promise.all([
waitXBlocksPassed('http://127.0.0.1:8001', 4),
waitXBlocksPassed('http://127.0.0.1:8002', 4),
waitXBlocksPassed('http://127.0.0.1:8003', 4),
waitXBlocksPassed('http://127.0.0.1:8004', 4),
]))
EOF
timeout-minutes: 1
- name: Archive logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: multi-axon-nodes-logs
path: |
${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes/