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