-
Notifications
You must be signed in to change notification settings - Fork 23
136 lines (120 loc) · 3.78 KB
/
ldk-node-integration.yml
File metadata and controls
136 lines (120 loc) · 3.78 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: LDK Node Integration Tests
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-postgres:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:latest
ports: [5432:5432]
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: vss-server
- name: Checkout LDK Node
uses: actions/checkout@v3
with:
repository: lightningdevkit/ldk-node
path: ldk-node
- name: Create Postgres config
run: |
mkdir -p vss-server/rust/server
cat > vss-server/rust/server/vss-server-config.toml <<EOF
[server_config]
host = "127.0.0.1"
port = 8080
store_type = "postgres"
[postgresql_config]
host = "localhost"
port = 5432
database = "postgres"
username = "postgres"
password = "postgres"
EOF
- name: Build & Start VSS Server
working-directory: vss-server/rust
run: |
cargo build --release --bin vss-server
./target/release/vss-server ./server/vss-server-config.toml > server.log 2>&1 &
echo "Server PID: $!"
- name: Wait for VSS
run: |
for i in {1..30}; do
if curl -s http://127.0.0.1:8080/vss > /dev/null; then
echo "VSS ready"
exit 0
fi
sleep 2
done
echo "VSS failed:"
cat vss-server/rust/server.log
exit 1
cd vss-server/rust
cargo build
cargo run --no-default-features server/vss-server-config.toml&
- name: Run LDK Node Integration tests
working-directory: ldk-node
run: |
export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
test-in-memory:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: vss-server
- name: Checkout LDK Node
uses: actions/checkout@v3
with:
repository: lightningdevkit/ldk-node
path: ldk-node
- name: Create In-Memory config
run: |
mkdir -p vss-server/rust/server
cat > vss-server/rust/server/vss-server-config.toml <<EOF
[server_config]
host = "127.0.0.1"
port = 8080
store_type = "in-memory"
EOF
- name: Build & Start VSS Server
working-directory: vss-server/rust
run: |
cargo build --release --bin vss-server
./target/release/vss-server ./server/vss-server-config.toml --in-memory > server.log 2>&1 &
echo "Server PID: $!"
- name: Wait for VSS
run: |
for i in {1..30}; do
if curl -s http://127.0.0.1:8080/vss > /dev/null; then
echo "VSS ready"
exit 0
fi
sleep 1
done
echo "VSS failed:"
cat vss-server/rust/server.log
exit 1
- name: Run LDK Node Integration tests
working-directory: ldk-node
run: |
export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss