Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a PostgreSQL service container in the GitHub workflow #3680

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/test_pgdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading