Skip to content

Commit

Permalink
Add go ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Lun4m committed Nov 14, 2024
1 parent 954774b commit af57225
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/go_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Continuous integration for Go migration package

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- 'migrations'

jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest

defaults:
run:
working-directory: migrations

services:
postgres:
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# 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
- 5432:5432
steps:
- uses: actions/checkout@v5

- name: Setup Go 1.22.x
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
cache-dependency-path: migrations/go.sum

- name: Install dependencies
run: go get

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

- name: Run tests
run: go test -v ./...

0 comments on commit af57225

Please sign in to comment.