testutils: fix pg dump path #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16-alpine | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
ports: | |
- 6666:5432 | |
options: >- | |
--health-cmd="pg_isready -U postgres" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Setup pg_dump | |
run: | | |
sudo apt-get install postgresql-client-16 | |
which pg_dump | |
- name: Wait for PostgreSQL to be ready | |
run: | | |
while ! pg_isready -h 127.0.0.1 -p 6666 -U postgres; do | |
echo "Waiting for PostgreSQL..." | |
sleep 1 | |
done | |
- name: Run tests | |
env: | |
PG_DUMP_PATH: /usr/bin/pg_dump | |
run: | | |
go test -v ./... |