@@ -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,20 +29,108 @@ 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
40+ 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
4057 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/vss.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
84+
85+ test-in-memory :
86+ runs-on : ubuntu-latest
87+ timeout-minutes : 30
88+
89+ steps :
90+ - name : Checkout code
91+ uses : actions/checkout@v3
92+ with :
93+ path : vss-server
94+
95+ - name : Checkout LDK Node
96+ uses : actions/checkout@v3
97+ with :
98+ repository : lightningdevkit/ldk-node
99+ path : ldk-node
100+
101+ - name : Create In-Memory config
102+ run : |
103+ mkdir -p vss-server/rust/server
104+ cat > vss-server/rust/server/vss-server-config.toml <<EOF
105+ [server_config]
106+ host = "127.0.0.1"
107+ port = 8080
108+ store_type = "in_memory"
109+ EOF
110+
111+ - name : Build & Start VSS Server
112+ working-directory : vss-server/rust
113+ run : |
114+ cargo build --release --bin vss-server
115+ ./target/release/vss-server ./server/vss-server-config.toml > server.log 2>&1 &
116+ echo "Server PID: $!"
117+
118+ - name : Wait for VSS
119+ run : |
120+ for i in {1..30}; do
121+ if curl -s http://127.0.0.1:8080/vss > /dev/null; then
122+ echo "VSS ready"
123+ exit 0
124+ fi
125+ sleep 1
126+ done
127+ echo "VSS failed:"
128+ cat vss-server/rust/vss.log
129+ exit 1
130+
131+ - name : Run LDK Node Integration tests
132+ working-directory : ldk-node
133+ run : |
134+ export TEST_VSS_BASE_URL="http://127.0.0.1:8080/vss"
135+ RUSTFLAGS="--cfg vss_test" cargo test io::vss_store
136+ RUSTFLAGS="--cfg vss_test" cargo test --test integration_tests_vss
0 commit comments