-
Notifications
You must be signed in to change notification settings - Fork 17
159 lines (137 loc) · 4.49 KB
/
Copy pathgeneral.yml
File metadata and controls
159 lines (137 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: General workflows
on:
push:
branches: [master]
pull_request:
branches: [master]
# Cancel superseded runs on a branch so a force-push / amend doesn't waste CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
# Keep in sync with go.mod's `go` directive (currently 1.19). Using
# stable runs the newest toolchain Go will accept while still
# exercising the minimum language level declared in go.mod.
go-version: stable
check-latest: true
cache: true
- name: Verify go.mod / go.sum are tidy
run: |
go mod tidy
if ! git diff --quiet go.mod go.sum; then
echo "::error::go.mod or go.sum is not tidy — run 'go mod tidy' locally and commit."
git diff go.mod go.sum
exit 1
fi
- name: Check gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "::error::The following files are not gofmt'd:"
echo "$unformatted"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go build
run: go build ./...
- name: Install mockgen
# Required by the //go:generate directives across the tree.
# Pinned to v1.6.0 to match the github.com/golang/mock dep in go.mod.
run: go install github.com/golang/mock/mockgen@v1.6.0
- name: go generate produces no diff
run: |
go generate ./...
if ! git diff --quiet; then
echo "::error::go generate produced changes — regenerate mocks locally and commit."
git status
git diff
exit 1
fi
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
# Pinned because golangci-lint v1.64.5 ships its own bundled type-
# checker; using `stable` makes that typechecker fail to resolve
# methods promoted through embedded external types (e.g. testify's
# suite.Suite.Assert), even though `go build` and `go test` succeed.
# The pin must satisfy go.mod's `go` directive; bump in lockstep
# when go.mod's minimum changes.
go-version: '1.24'
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Pin a recent stable release; bump with intent, not passively.
# When bumping the linter, also bump go-version above to match.
version: v1.64.5
args: --timeout=5m
test:
name: Test Coverage
runs-on: ubuntu-latest
needs: verify
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
cache: true
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Unit Test
run: make test
- name: Upload coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=cover.out -service=github
smoke:
# Full end-to-end smoke matrix (Phase A gateway-only + Phase B oauth +
# MySQL). Builds the binary, runs `altair new`, spawns it as a
# subprocess, and asserts forwarding + proxy options + the oauth
# auth/scope/body matrix. ~10s wall time on the runner; MySQL via the
# services: block (no docker-compose / no DinD).
# Spec: docs/superpowers/specs/2026-04-23-altair-smoke-test-design.md
name: Smoke (e2e)
runs-on: ubuntu-latest
needs: verify
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: altair_development
ports:
- '3306:3306'
options: >-
--health-cmd="mysqladmin ping -uroot -proot"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
cache: true
- name: Smoke Test
run: make smoke