Skip to content

Commit

Permalink
chore: add postgres service in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aseerkt committed Mar 27, 2024
1 parent f926682 commit 95fc356
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:16-alpine
# Provide the password for postgres
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: secret
POSTGRES_DB: simple_bank
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5433:5432
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -21,6 +40,9 @@ jobs:
with:
go-version: "1.22.0"

- name: Migration
run: make migrateup

- name: Build
run: go build -v ./...

Expand Down

0 comments on commit 95fc356

Please sign in to comment.