-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1008 Bytes
/
ci-postgres.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go-Postgres CI Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
container: golang:1.23.5-alpine
services: # service containers to run with test job
postgres: # label used to access the service container
image: postgres:latest
env: # service environment variables
POSTGRES_DB: postgres_db
POSTGRES_PASSWORD: postgres_password
POSTGRES_PORT: 5432
POSTGRES_USER: postgres_user
# set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Go Test
run: go test -v ci_test.go