fix(pipeline): Launch postgres docker container for testing
This commit is contained in:
@@ -16,6 +16,22 @@ on:
|
||||
jobs:
|
||||
build-and-test:
|
||||
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:
|
||||
run:
|
||||
working-directory: ./legalconsenthub-backend
|
||||
@@ -50,12 +66,13 @@ jobs:
|
||||
- name: Run ktlint check
|
||||
run: ./gradlew ktlintCheck
|
||||
|
||||
- name: Run tests with Testcontainers
|
||||
- name: Run tests
|
||||
run: ./gradlew test
|
||||
env:
|
||||
SPRING_PROFILES_ACTIVE: testcontainers
|
||||
TESTCONTAINERS_RYUK_DISABLED: true
|
||||
TESTCONTAINERS_CHECKS_DISABLE: true
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/legalconsenthub_test
|
||||
SPRING_DATASOURCE_USERNAME: test
|
||||
SPRING_DATASOURCE_PASSWORD: test
|
||||
SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
Reference in New Issue
Block a user