Skip to content

wip: 2024-11-30 13:39:05 #166

wip: 2024-11-30 13:39:05

wip: 2024-11-30 13:39:05 #166

Workflow file for this run

name: Test
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "^1.23"
- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v6
- name: Lint with gofmt and go vet
run: |
gofmt -l -e .
go vet ./...
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: dev
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 6543:5432
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "^1.23"
- name: Get Go cache paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('go.sum') }}
- name: Go Mod Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('go.sum') }}
- name: Test
run: |
go test -race ./...