58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
|
name: checks
|
||
|
|
||
|
on:
|
||
|
- pull_request
|
||
|
- push
|
||
|
|
||
|
env:
|
||
|
GO_VERSION: 1.17
|
||
|
CGO_ENABLED: 0
|
||
|
|
||
|
jobs:
|
||
|
tests:
|
||
|
name: tests
|
||
|
runs-on: ubuntu-latest
|
||
|
services:
|
||
|
postgres:
|
||
|
image: postgres:12
|
||
|
env:
|
||
|
POSTGRES_USER: postgres
|
||
|
POSTGRES_PASSWORD: postgres
|
||
|
POSTGRES_DB: booktown
|
||
|
ports:
|
||
|
- 5432:5432
|
||
|
options: >-
|
||
|
--health-cmd pg_isready
|
||
|
--health-interval 10s
|
||
|
--health-timeout 5s
|
||
|
--health-retries 5
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- uses: actions/setup-go@v2
|
||
|
with:
|
||
|
go-version: ${{ env.GO_VERSION }}
|
||
|
- run: go mod download
|
||
|
- run: make test
|
||
|
env:
|
||
|
MallocNanoZone: 0 # https://github.com/golang/go/issues/49138
|
||
|
CGO_ENABLED: 1
|
||
|
PGHOST: localhost
|
||
|
PGUSER: postgres
|
||
|
PGPASSWORD: postgres
|
||
|
PGDATABASE: booktown
|
||
|
|
||
|
fmt:
|
||
|
name: fmt
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- uses: actions/setup-go@v2
|
||
|
with:
|
||
|
go-version: ${{ env.GO_VERSION }}
|
||
|
- run: go mod download
|
||
|
- run: script/check_formatting.sh
|