fix(pipeline): Launch postgres docker container for testing
This commit is contained in:
@@ -16,6 +16,22 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: legalconsenthub_test
|
||||||
|
POSTGRES_USER: test
|
||||||
|
POSTGRES_PASSWORD: test
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd "pg_isready -U test"
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./legalconsenthub-backend
|
working-directory: ./legalconsenthub-backend
|
||||||
@@ -50,12 +66,13 @@ jobs:
|
|||||||
- name: Run ktlint check
|
- name: Run ktlint check
|
||||||
run: ./gradlew ktlintCheck
|
run: ./gradlew ktlintCheck
|
||||||
|
|
||||||
- name: Run tests with Testcontainers
|
- name: Run tests
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
env:
|
env:
|
||||||
SPRING_PROFILES_ACTIVE: testcontainers
|
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/legalconsenthub_test
|
||||||
TESTCONTAINERS_RYUK_DISABLED: true
|
SPRING_DATASOURCE_USERNAME: test
|
||||||
TESTCONTAINERS_CHECKS_DISABLE: true
|
SPRING_DATASOURCE_PASSWORD: test
|
||||||
|
SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|||||||
Reference in New Issue
Block a user