diff --git a/.github/workflows/test_pgdb.yaml b/.github/workflows/test_pgdb.yaml index 5759f1a0b2..0dd96ca4bf 100644 --- a/.github/workflows/test_pgdb.yaml +++ b/.github/workflows/test_pgdb.yaml @@ -32,6 +32,21 @@ jobs: integration-and-unit-tests: runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_HOST_AUTH_METHOD: trust + options: >- + --name pgsql + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -44,20 +59,6 @@ jobs: - name: Build before tests run: go mod download && go build ./... - - name: Run PostgreSQL - run: docker run --rm -d --name=pgsql -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:latest - - - name: Wait for PostgreSQL - uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: docker exec pgsql psql -U postgres -c "SELECT 1" - - - name: Get PostgreSQL logs - run: docker logs pgsql 2>&1 - - name: Run integration tests run: ./integration/integration_test.sh env: diff --git a/CHANGELOG.md b/CHANGELOG.md index e4c8382d06..f518190a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Add PostgreSQL quota manager and storage backend by @robstradling in https://github.com/google/trillian/pull/3644 * PostgreSQL deployment example by @robstradling in https://github.com/google/trillian/pull/3675 * PostgreSQL documentation / consistency fixes by @robstradling in https://github.com/google/trillian/pull/3676 +* Use a PostgreSQL service container in the GitHub workflow by @robstradling in https://github.com/google/trillian/pull/3680 ### Misc