@@ -7,14 +7,13 @@ concurrency:
77 cancel-in-progress : true
88
99jobs :
10- build-and- test :
10+ test-postgres :
1111 runs-on : ubuntu-latest
12-
12+ timeout-minutes : 20
1313 services :
1414 postgres :
1515 image : postgres:latest
16- ports :
17- - 5432:5432
16+ ports : [5432:5432]
1817 env :
1918 POSTGRES_DB : postgres
2019 POSTGRES_USER : postgres
@@ -28,22 +27,102 @@ jobs:
2827 steps :
2928 - name : Checkout code
3029 uses : actions/checkout@v3
31- with :
32- path : vss-server
30+ with : { path: vss-server }
3331 - name : Checkout LDK Node
3432 uses : actions/checkout@v3
3533 with :
3634 repository : lightningdevkit/ldk-node
3735 path : ldk-node
3836
39- - name : Build and Deploy VSS Server
37+ - name : Create Postgres config
38+ run : |
39+ mkdir -p vss-server/rust/server
40+ cat > vss-server/rust/server/vss-server-config.toml <<EOF
41+ [server_config]
42+ host = "127.0.0.1"
43+ port = 8080
44+ store_type = "postgres"
45+ [postgresql_config]
46+ host = "localhost"
47+ port = 5432
48+ database = "postgres"
49+ username = "postgres"
50+ password = "postgres"
51+ EOF
52+
53+ - name : Build & Start VSS Server
4054 run : |
4155 cd vss-server/rust
42- cargo build
43- cargo run server/vss-server-config.toml&
56+ cargo build --release --bin server
57+ ./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
58+ echo "VSS PID: $!"
59+
60+ - name : Wait for VSS
61+ run : |
62+ for i in {1..30}; do
63+ if curl -s http://127.0.0.1:8080/vss > /dev/null 2>&1; then
64+ echo "VSS ready!"
65+ exit 0
66+ fi
67+ sleep 2
68+ done
69+ echo "VSS failed:"
70+ cat vss-server/rust/server/vss.log
71+ exit 1
72+
4473 - name : Run LDK Node Integration tests
4574 run : |
4675 cd ldk-node
47- export TEST_VSS_BASE_URL="http://localhost :8080/vss"
76+ export TEST_VSS_BASE_URL="http://127.0.0.1 :8080/vss"
4877 RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
4978 RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
79+
80+ test-in-memory :
81+ runs-on : ubuntu-latest
82+ timeout-minutes : 10
83+ steps :
84+ - name : Checkout code
85+ uses : actions/checkout@v3
86+ with : { path: vss-server }
87+ - name : Checkout LDK Node
88+ uses : actions/checkout@v3
89+ with :
90+ repository : lightningdevkit/ldk-node
91+ path : ldk-node
92+
93+ - name : Create In-Memory config
94+ run : |
95+ mkdir -p vss-server/rust/server
96+ cat > vss-server/rust/server/vss-server-config.toml <<EOF
97+ [server_config]
98+ host = "127.0.0.1"
99+ port = 8080
100+ store_type = "in_memory"
101+ EOF
102+
103+ - name : Build & Start VSS Server
104+ run : |
105+ cd vss-server/rust
106+ cargo build --release --bin server
107+ ./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
108+ echo "VSS PID: $!"
109+
110+ - name : Wait for VSS
111+ run : |
112+ for i in {1..30}; do
113+ if curl -s http://127.0.0.1:8080/vss > /dev/null 2>&1; then
114+ echo "VSS ready!"
115+ exit 0
116+ fi
117+ sleep 2
118+ done
119+ echo "VSS failed:"
120+ cat vss-server/rust/server/vss.log
121+ exit 1
122+
123+ - name : Run LDK Node Integration tests
124+ run : |
125+ cd ldk-node
126+ export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
127+ RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
128+ RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
0 commit comments