CI / test (push) Successful in 1m5s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
# Tests the hub (against a real Postgres, a service container here) and builds it.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GOPRIVATE: git.t5de.dev
|
|
# Jobs run as root, which embedded Postgres refuses: the tests use this service instead.
|
|
T5DE_TEST_DB: postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd "pg_isready -U postgres" --health-interval 2s --health-timeout 5s --health-retries 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Test
|
|
run: |
|
|
unformatted=$(gofmt -l .)
|
|
if [ -n "$unformatted" ]; then echo "Not gofmt-formatted: $unformatted"; exit 1; fi
|
|
go vet ./...
|
|
go test ./...
|
|
|
|
- name: Build
|
|
run: CGO_ENABLED=0 go build -trimpath -o dist/t5de-hub ./cmd/t5de-hub
|