From 26814db8d9973429a7ab7444bdb472f4e761dce4 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Sat, 11 Dec 2021 20:47:40 +0100 Subject: [PATCH] Add dependecies for hsqldb (#132) * add dependecies for h2 db * Attempt to test h2 with docker-compose. * bump h2 to 2.0.202 * add dependecies for h2 db * use pgsql mode * switch to hsqldb * fix hibernate dialect Co-authored-by: FireMaskterK <20838718+FireMasterK@users.noreply.github.com> --- .github/workflows/docker-build-test.yml | 9 +++++++-- build.gradle | 1 + api-test.sh => testing/api-test.sh | 0 testing/config.hsqldb.properties | 18 ++++++++++++++++++ testing/docker-compose.hsqldb.yml | 8 ++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) rename api-test.sh => testing/api-test.sh (100%) create mode 100644 testing/config.hsqldb.properties create mode 100644 testing/docker-compose.hsqldb.yml diff --git a/.github/workflows/docker-build-test.yml b/.github/workflows/docker-build-test.yml index f3ef9bd..ea817d3 100644 --- a/.github/workflows/docker-build-test.yml +++ b/.github/workflows/docker-build-test.yml @@ -9,6 +9,11 @@ on: jobs: build-hotspot-test: runs-on: ubuntu-latest + strategy: + matrix: + docker-compose-file: + - docker-compose.yml + - testing/docker-compose.hsqldb.yml steps: - uses: actions/checkout@v2.4.0 with: @@ -16,6 +21,6 @@ jobs: - name: Build Locally run: docker build . -t 1337kavin/piped:latest - name: Start Docker-Compose services - run: docker-compose up -d && sleep 5 + run: docker-compose -f ${{ matrix.docker-compose-file }} up -d && sleep 5 - name: Run tests - run: ./api-test.sh + run: ./testing/api-test.sh diff --git a/build.gradle b/build.gradle index 6bcc0ca..314b32f 100644 --- a/build.gradle +++ b/build.gradle @@ -31,6 +31,7 @@ dependencies { implementation 'io.activej:activej-boot:5.0' implementation 'io.activej:activej-specializer:5.0' implementation 'io.activej:activej-launchers-http:5.0' + implementation 'org.hsqldb:hsqldb:2.6.1' implementation 'org.postgresql:postgresql:42.3.1' implementation 'org.hibernate:hibernate-core:5.6.1.Final' implementation 'org.hibernate:hibernate-hikaricp:5.6.1.Final' diff --git a/api-test.sh b/testing/api-test.sh similarity index 100% rename from api-test.sh rename to testing/api-test.sh diff --git a/testing/config.hsqldb.properties b/testing/config.hsqldb.properties new file mode 100644 index 0000000..53552f6 --- /dev/null +++ b/testing/config.hsqldb.properties @@ -0,0 +1,18 @@ +# The port to Listen on. +PORT: 8080 + +# Proxy +PROXY_PART: https://pipedproxy-ams.kavin.rocks + +# Public API URL +API_URL: https://pipedapi.kavin.rocks + +# Public Frontend URL +FRONTEND_URL: https://piped.kavin.rocks + +# Hibernate properties +hibernate.connection.url: jdbc:hsqldb:mem:memdb;sql.syntax_pgs=true +hibernate.connection.driver_class: org.hsqldb.jdbcDriver +hibernate.dialect: org.hibernate.dialect.HSQLDialect +hibernate.connection.username: piped +hibernate.connection.password: changeme diff --git a/testing/docker-compose.hsqldb.yml b/testing/docker-compose.hsqldb.yml new file mode 100644 index 0000000..31f4070 --- /dev/null +++ b/testing/docker-compose.hsqldb.yml @@ -0,0 +1,8 @@ +services: + piped: + image: 1337kavin/piped:latest + restart: unless-stopped + ports: + - "127.0.0.1:8080:8080" + volumes: + - ./config.hsqldb.properties:/app/config.properties