-
Notifications
You must be signed in to change notification settings - Fork 24
128 lines (115 loc) · 3.56 KB
/
ldk-node-integration.yml
File metadata and controls
128 lines (115 loc) · 3.56 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
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: 20
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
run: |
cd vss-server/rust
cargo build --release --bin server
./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
echo "VSS PID: $!"
- name: Wait for VSS
run: |
for i in {1..30}; do
if curl -s http://127.0.0.1:8080/vss > /dev/null 2>&1; then
echo "VSS ready!"
exit 0
fi
sleep 2
done
echo "VSS failed:"
cat vss-server/rust/server/vss.log
exit 1
- name: Run LDK Node Integration tests
run: |
cd ldk-node
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: 10
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
run: |
cd vss-server/rust
cargo build --release --bin server
./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
echo "VSS PID: $!"
- name: Wait for VSS
run: |
for i in {1..30}; do
if curl -s http://127.0.0.1:8080/vss > /dev/null 2>&1; then
echo "VSS ready!"
exit 0
fi
sleep 2
done
echo "VSS failed:"
cat vss-server/rust/server/vss.log
exit 1
- name: Run LDK Node Integration tests
run: |
cd ldk-node
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