diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c5141e7..7f1555e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,14 +9,27 @@ on: jobs: test: runs-on: ubuntu-latest + services: + postgres: + image: postgres:11.5 + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v4 with: go-version: stable - name: Test run: go test ./... + env: + TEST_PAGESHIP_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable diff --git a/docker-compose.yaml b/docker-compose.yaml index 7dd2d54..8840f97 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -21,6 +21,8 @@ services: image: postgres:11.5 volumes: - data:/data + ports: + - "5432:5432" controller: image: ghcr.io/oursky/pageship-controller