Skip to content

Add tern migrator

Add tern migrator #94

Workflow file for this run

name: golang
on:
push:
branches:
- main
pull_request:
jobs:
test:
services:
postgres:
image: postgis/postgis:15-master
env:
POSTGRES_PASSWORD: password
# TODO: unable to turn off fsync easily, see
# https://github.com/orgs/community/discussions/26688#discussioncomment-3252882
# and
# https://github.com/actions/runner/discussions/1872
ports:
- 5433:5432
# Use a temporary directory for data by passing --mount to the `docker`
# command; could also attempt to use the volumes: github serrvice
# option.
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
cache-dependency-path: go.sum
- name: install atlas CLI
run: curl -sSf https://atlasgo.sh | sh
- name: test all
run: go test github.com/peterldowns/pgtestdb/...
- name: test all -race
run: go test -race github.com/peterldowns/pgtestdb/...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
cache-dependency-path: go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
- name: go mod tidy
run: go mod tidy
- name: check for any changes
run: |
[[ $(git status --porcelain) == "" ]] || (echo "changes detected" && exit 1)