From ee5f15f303470dfe3c970a95ec68da2168a0ee1c Mon Sep 17 00:00:00 2001 From: Gursharan Singh <3442979+G8XSU@users.noreply.github.com> Date: Wed, 30 Aug 2023 19:09:25 -0700 Subject: [PATCH] Add VSS Store CI Integ Test --- .github/workflows/vss-integration.yml | 82 +++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/vss-integration.yml diff --git a/.github/workflows/vss-integration.yml b/.github/workflows/vss-integration.yml new file mode 100644 index 000000000..50cc8db70 --- /dev/null +++ b/.github/workflows/vss-integration.yml @@ -0,0 +1,82 @@ +name: VSS Integration Test + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:latest + ports: + - 5432:5432 + env: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: testpassword + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + path: ldk-node + - name: Checkout VSS + uses: actions/checkout@v3 + with: + repository: lightningdevkit/vss-server + path: vss-server + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + + - name: Start Tomcat + run: | + docker run -d --network=host --name tomcat tomcat:latest + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: release-candidate + + - name: Create database table + run: | + psql -h localhost -U postgres -d postgres -f ./vss-server/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql + env: + PGPASSWORD: testpassword + + - name: Build and Deploy VSS + run: | + # Print Info + java -version + gradle --version + + cd vss-server + gradle wrapper --gradle-version 8.1.1 + ./gradlew --version + ./gradlew build + + docker cp app/build/libs/app-1.0.war tomcat:/usr/local/tomcat/webapps/vss.war + cd ../ + - name: Run VSS Integration tests against vss-instance. + run: | + cd ldk-node + export TEST_VSS_BASE_URL="http://localhost:8080/vss" + cargo build --features=vss,vss-test --verbose --color always + cargo test --features=vss,vss-test -- --nocapture + + - name: Cleanup + run: | + docker stop tomcat && docker rm tomcat