diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index bedf50d..0cec358 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -32,6 +32,22 @@ jobs: test: name: Test Suite runs-on: ubuntu-24.04 + # --- Add database service definition --- + services: + postgres: + image: postgres:17.4 # Or pin to a more specific version like 14.9 + env: + # Use secrets for DB init, with fallbacks for flexibility + POSTGRES_USER: ${{ secrets.DB_TEST_USER || 'testuser' }} + POSTGRES_PASSWORD: ${{ secrets.DB_TEST_PASSWORD || 'testpassword' }} + POSTGRES_DB: ${{ secrets.DB_TEST_NAME || 'testdb' }} + # Options to wait until the database is ready + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1