Add PostgreSQL service to GitHub Actions workflow for integration tests

This commit is contained in:
2025-03-07 22:31:00 +01:00
parent d97f5a0178
commit d0f6f27526

View File

@@ -13,6 +13,21 @@ jobs:
name: Run Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: lemma_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: ./server
@@ -29,6 +44,8 @@ jobs:
- name: Run Tests
run: go test -tags=test,integration ./... -v
env:
LEMMA_TEST_POSTGRES_URL: "postgres://postgres:postgres@localhost:5432/lemma_test?sslmode=disable"
- name: Run Tests with Race Detector
run: go test -tags=test,integration -race ./... -v