Skip to content

Commit

Permalink
use postgres service
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Nov 4, 2024
1 parent 7dc73fc commit 6536e9f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ jobs:
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}

services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
PGUSER: "postgres"
POSTGRESPORT: 5432
PGHOST: "localhost"
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Check out the repository
uses: actions/checkout@v4
Expand All @@ -186,17 +204,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up postgres (linux)
if: runner.os == 'Linux'
uses: ./.github/actions/setup-postgres-linux

- name: Set up postgres (macos)
if: runner.os == 'macOS'
uses: ./.github/actions/setup-postgres-macos

- name: Set up postgres (windows)
if: runner.os == 'Windows'
uses: ./.github/actions/setup-postgres-windows
- name: "Set up postgres"
run: |
./test/setup_db.sh
- name: Install python tools
run: |
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/test-repeater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}

# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
Expand All @@ -89,6 +88,9 @@ jobs:
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
PGUSER: "postgres"
POSTGRESPORT: 5432
PGHOST: "localhost"
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand All @@ -110,19 +112,6 @@ jobs:
- name: "Setup Dev Environment"
run: make dev

# - name: "Set up postgres (linux)"
# if: inputs.os == 'ubuntu-latest'
# run: make setup-db

# # mac and windows don't use make due to limitations with docker with those runners in GitHub
# - name: "Set up postgres (macos)"
# if: inputs.os == 'macos-14'
# uses: ./.github/actions/setup-postgres-macos

# - name: "Set up postgres (windows)"
# if: inputs.os == 'windows-latest'
# uses: ./.github/actions/setup-postgres-windows

- name: "Set up postgres"
run: |
./test/setup_db.sh
Expand Down

0 comments on commit 6536e9f

Please sign in to comment.