Skip to content

Commit fbe6f29

Browse files
authored
Merge pull request #161 from G8XSU/vss-ci
Add VSS Store CI Integ Test
2 parents 15f4f2a + d20e4f0 commit fbe6f29

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/vss-integration.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: VSS Integration Test
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
postgres:
15+
image: postgres:latest
16+
ports:
17+
- 5432:5432
18+
env:
19+
POSTGRES_DB: postgres
20+
POSTGRES_USER: postgres
21+
POSTGRES_PASSWORD: YOU_MUST_CHANGE_THIS_PASSWORD
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v3
31+
with:
32+
path: ldk-node
33+
- name: Checkout VSS
34+
uses: actions/checkout@v3
35+
with:
36+
repository: lightningdevkit/vss-server
37+
path: vss-server
38+
39+
- name: Set up Java
40+
uses: actions/setup-java@v3
41+
with:
42+
distribution: 'corretto'
43+
java-version: '17'
44+
45+
- name: Start Tomcat
46+
run: |
47+
docker run -d --network=host --name tomcat tomcat:latest
48+
49+
- name: Setup Gradle
50+
uses: gradle/gradle-build-action@v2
51+
with:
52+
gradle-version: release-candidate
53+
54+
- name: Create database table
55+
run: |
56+
psql -h localhost -U postgres -d postgres -f ./vss-server/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql
57+
env:
58+
PGPASSWORD: YOU_MUST_CHANGE_THIS_PASSWORD
59+
60+
- name: Build and Deploy VSS
61+
run: |
62+
# Print Info
63+
java -version
64+
gradle --version
65+
66+
cd vss-server
67+
gradle wrapper --gradle-version 8.1.1
68+
./gradlew --version
69+
./gradlew build
70+
71+
docker cp app/build/libs/app-1.0.war tomcat:/usr/local/tomcat/webapps/vss.war
72+
cd ../
73+
- name: Run VSS Integration tests against vss-instance.
74+
run: |
75+
cd ldk-node
76+
export TEST_VSS_BASE_URL="http://localhost:8080/vss"
77+
RUSTFLAGS="--cfg=vss_test --cfg=vss" cargo build --verbose --color always
78+
RUSTFLAGS="--cfg=vss_test --cfg=vss" cargo test -- --nocapture
79+
80+
- name: Cleanup
81+
run: |
82+
docker stop tomcat && docker rm tomcat

0 commit comments

Comments
 (0)