CI / Test / lint-setup-go-cache (pull_request) Successful in 14s
minimal-ci / minimal-validate (pull_request) Successful in 21s
minimal-validate baseline hygiene OK
minimal-ci / minimal-validate (push) Successful in 30s
CI / Test / test (pull_request) Successful in 46s
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
name: CI / Test
|
|
|
|
# Runs on every PR/push that touches Go code, workflow definitions, or an input
|
|
# to the release-guidance contract tests. Go 1.25 matches the module toolchain
|
|
# declared in go.mod.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.gitea/workflows/ci.yml'
|
|
- '.gitea/workflows/*.yml'
|
|
- 'internal/lint/**'
|
|
- 'README.md'
|
|
- 'CLAUDE.md'
|
|
- '.goreleaser.yaml'
|
|
- '.github/workflows/release.yml'
|
|
- 'known-issues.md'
|
|
- 'pr-description-draft-cli-full.md'
|
|
pull_request:
|
|
paths:
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.gitea/workflows/ci.yml'
|
|
- '.gitea/workflows/*.yml'
|
|
- 'internal/lint/**'
|
|
- 'README.md'
|
|
- 'CLAUDE.md'
|
|
- '.goreleaser.yaml'
|
|
- '.github/workflows/release.yml'
|
|
- 'known-issues.md'
|
|
- 'pr-description-draft-cli-full.md'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
# The self-hosted fleet already mounts persistent Go caches. Letting
|
|
# setup-go restore another cache over those mounts corrupts them.
|
|
cache: false
|
|
- name: Tidy
|
|
run: go mod tidy && git diff --exit-code go.sum
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Test
|
|
# No -count=1: the runner fleet persists GOCACHE (operator-config#184),
|
|
# so unchanged packages legitimately reuse cached results ("(cached)").
|
|
# Tests here are hermetic (httptest mock servers); the cache invalidates
|
|
# on any source/dep change. Keep -race (76569b7 rationale: connect
|
|
# orchestrator heartbeat/poll goroutines).
|
|
run: go test -race ./...
|
|
|
|
# Guard against actions/setup-go cache:true (or default-true) on the
|
|
# self-hosted fleet. actions/cache untars over a bind-mounted host GOCACHE
|
|
# and corrupts it, so this is a required invariant rather than an advisory.
|
|
lint-setup-go-cache:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache: false
|
|
- name: Lint setup-go cache configuration
|
|
env:
|
|
CI_LINT_SETUP_GO_CACHE: "1"
|
|
run: go test ./internal/lint/...
|