@@ -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 : 30
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
@@ -30,21 +29,56 @@ jobs:
3029 uses : actions/checkout@v3
3130 with :
3231 path : vss-server
32+
3333 - name : Checkout LDK Node
3434 uses : actions/checkout@v3
3535 with :
3636 repository : lightningdevkit/ldk-node
3737 path : ldk-node
3838
39- - name : Build and Deploy VSS Server
39+ - name : Create Postgres config
4040 run : |
41+ mkdir -p vss-server/rust/server
42+ cat > vss-server/rust/server/vss-server-config.toml <<EOF
43+ [server_config]
44+ host = "127.0.0.1"
45+ port = 8080
46+ store_type = "postgres"
47+ [postgresql_config]
48+ host = "localhost"
49+ port = 5432
50+ database = "postgres"
51+ username = "postgres"
52+ password = "postgres"
53+ EOF
54+
55+ - name : Build & Start VSS Server
56+ working-directory : vss-server/rust
57+ run : |
58+ cargo build --release --bin vss-server
59+ ./target/release/vss-server ./server/vss-server-config.toml > server.log 2>&1 &
60+ echo "Server PID: $!"
61+
62+ - name : Wait for VSS
63+ run : |
64+ for i in {1..30}; do
65+ if curl -s http://127.0.0.1:8080/vss > /dev/null; then
66+ echo "VSS ready"
67+ exit 0
68+ fi
69+ sleep 2
70+ done
71+ echo "VSS failed:"
72+ cat vss-server/rust/server.log
73+ exit 1
74+
4175 cd vss-server/rust
4276 cargo build
4377 cargo run --no-default-features server/vss-server-config.toml&
4478 - name : Run LDK Node Integration tests
79+ working-directory : ldk-node
4580 run : |
46- cd ldk-node
47- export TEST_VSS_BASE_URL="http://localhost:8080/vss"
81+ export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
4882 RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
4983 RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
5084
91125 sleep 1
92126 done
93127 echo "VSS failed:"
94- cat vss-server/rust/vss .log
128+ cat vss-server/rust/server .log
95129 exit 1
96130
97131 - name : Run LDK Node Integration tests
0 commit comments