Skip to content

update

update #3

Workflow file for this run

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: 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
run: |
go test -v ./...