fix(ci): add PostgreSQL service container for integration tests

Integration tests require a real PostgreSQL database to connect to.
Added PostgreSQL 17 service container with proper health checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2025-12-15 12:42:25 +00:00
parent aedc1ad9e4
commit c244b4ea62

View file

@ -82,6 +82,20 @@ jobs:
name: Tests
runs-on: ubuntu-latest
needs: [lint, typecheck]
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: payload
POSTGRES_PASSWORD: payload_test_password
POSTGRES_DB: payload_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -120,7 +134,7 @@ jobs:
PAYLOAD_PUBLIC_SERVER_URL: https://test.example.com
NEXT_PUBLIC_SERVER_URL: https://test.example.com
EMAIL_DELIVERY_DISABLED: 'true'
DATABASE_URI: postgresql://placeholder:placeholder@localhost:5432/placeholder
DATABASE_URI: postgresql://payload:payload_test_password@localhost:5432/payload_test
CONSENT_LOGGING_API_KEY: ci-consent-api-key-placeholder
IP_ANONYMIZATION_PEPPER: ci-anonymization-pepper-placeholder