@@ -7,19 +7,14 @@ concurrency:
77 cancel-in-progress : true
88
99jobs :
10- build-and-test :
11- strategy :
12- fail-fast : false
13- matrix :
14- platform : [ ubuntu-latest ]
15- toolchain : [ stable, 1.85.0 ] # 1.85.0 is the MSRV
16- runs-on : ${{ matrix.platform }}
10+ test-postgres :
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 30
1713
1814 services :
1915 postgres :
2016 image : postgres:latest
21- ports :
22- - 5432:5432
17+ ports : [5432:5432]
2318 env :
2419 POSTGRES_DB : postgres
2520 POSTGRES_USER : postgres
@@ -35,21 +30,52 @@ jobs:
3530 uses : actions/checkout@v3
3631 with :
3732 path : vss-server
33+
3834 - name : Checkout LDK Node
3935 uses : actions/checkout@v3
4036 with :
4137 repository : lightningdevkit/ldk-node
4238 path : ldk-node
4339
44- - name : Build and Deploy VSS Server
40+ - name : Create Postgres config
41+ run : |
42+ mkdir -p vss-server/rust/server
43+ cat > vss-server/rust/server/vss-server-config.toml <<EOF
44+ [server_config]
45+ bind_address = "127.0.0.1:8080"
46+ store_type = "postgres"
47+ [postgresql_config]
48+ username = "postgres"
49+ password = "postgres"
50+ address = "localhost:5432"
51+ default_database = "postgres"
52+ vss_database = "vss"
53+ EOF
54+
55+ - name : Build & Start VSS Server
56+ working-directory : vss-server/rust
4557 run : |
46- cd vss-server/rust
47- RUSTFLAGS="--cfg noop_authorizer" cargo build --no-default-features
48- ./target/debug/vss-server server/vss-server-config.toml&
58+ RUSTFLAGS="--cfg noop_authorizer" cargo build --release --no-default-features --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+
4975 - name : Run LDK Node Integration tests
76+ working-directory : ldk-node
5077 run : |
51- cd ldk-node
52- export TEST_VSS_BASE_URL="http://localhost:8080/vss"
78+ export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
5379 RUSTFLAGS="--cfg vss_test" cargo test io::vss_store -- --test-threads=1
5480 RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss -- --test-threads=1
5581
@@ -74,16 +100,15 @@ jobs:
74100 mkdir -p vss-server/rust/server
75101 cat > vss-server/rust/server/vss-server-config.toml <<EOF
76102 [server_config]
77- host = "127.0.0.1"
78- port = 8080
103+ bind_address = "127.0.0.1:8080"
79104 store_type = "in-memory"
80105 EOF
81106
82107 - name : Build & Start VSS Server
83108 working-directory : vss-server/rust
84109 run : |
85- cargo build --release --bin vss-server
86- ./target/release/vss-server ./server/vss-server-config.toml --in-memory > server.log 2>&1 &
110+ RUSTFLAGS="--cfg noop_authorizer" cargo build --release --no-default-features --bin vss-server
111+ ./target/release/vss-server ./server/vss-server-config.toml > server.log 2>&1 &
87112 echo "Server PID: $!"
88113
89114 - name : Wait for VSS
@@ -96,12 +121,12 @@ jobs:
96121 sleep 1
97122 done
98123 echo "VSS failed:"
99- cat vss-server/rust/vss .log
124+ cat vss-server/rust/server .log
100125 exit 1
101126
102127 - name : Run LDK Node Integration tests
103128 working-directory : ldk-node
104129 run : |
105130 export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
106- RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
107- RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
131+ RUSTFLAGS="--cfg vss_test" cargo test io::vss_store -- --test-threads=1
132+ RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss -- --test-threads=1
0 commit comments