Files
anchorage/.gitea/workflows/test.yml
William Gill ee52ae985d
Some checks failed
Security / Vulnerability Check (push) Failing after 16m47s
Test / Build & Unit Tests (push) Failing after 4m58s
Test / Integration Tests (push) Has been skipped
Test / Lint (push) Failing after 23s
ci: gitea actions — test, security, release
Three workflows modeled on kanrisha + Vortex:

* test.yml — on push/PR to main: build + vet + unit tests (-race), a
  gated integration job that runs go test -tags=integration ./test/...
  (testcontainers spins up Postgres 17 itself; runner must expose the
  docker socket), and a lint job (go mod tidy + gofmt check).
* security.yml — govulncheck on push to main plus a weekly Monday
  06:00 UTC cron so fresh CVEs surface without a code change.
* release.yml — on v* tag push only: goreleaser v2 with
  GORELEASER_FORCE_TOKEN=gitea + GITEA_SERVER_URL, plus a docker
  login step so the built image can push to Gitea's registry.

All three pin Go 1.26 (go.mod says 1.26.2). Release job requires the
TOKEN_GITEA repo secret (scope: packages + code:write).
2026-04-16 18:16:13 -05:00

64 lines
1.4 KiB
YAML

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build & Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Unit Tests
run: go test -short -race -count=1 ./...
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: build
# testcontainers brings up the Postgres container itself; the runner
# must therefore expose the Docker socket. Gitea's act_runner does
# this by default when the host mounts /var/run/docker.sock.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Integration Tests
run: go test -tags=integration -count=1 -timeout=10m ./test/...
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Check go.mod tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Check formatting
run: |
test -z "$(gofmt -l $(find . -name '*.go' -not -path './vendor/*'))"