-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (155 loc) · 5.89 KB
/
Copy pathci.yml
File metadata and controls
189 lines (155 loc) · 5.89 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
repo-refs:
name: Repo reference guard
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Check for stale/broken repo slug references
run: ./scripts/check-repo-refs.sh
- name: Check the version is consistent everywhere it is written down
run: ./scripts/check-version.sh
lint-test:
name: Lint & Test
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
# `make web-deps`, not a bare `npm ci`: `npm ci` refuses to run at all when
# web/package-lock.json does not match web/package.json, and the lock in this
# tree predates the vitest/eslint devDependencies. web-deps tries `npm ci`
# first and falls back to `npm install`, printing the real fix either way.
- name: Install web deps
run: make web-deps
- name: Build web UI into the go:embed directory
run: make ui-react
- name: Install golangci-lint
# `go install` (not the release install.sh + prebuilt binary) so the
# linter is always built with the SAME Go toolchain this job just set
# up — golangci-lint refuses to run when built with an older Go than
# the module it's targeting, so a prebuilt binary silently breaks
# every time the pinned toolchain in go.mod moves past it. install.sh
# also matched the wrong release asset for v2.13.1 (grabbed the
# .sbom.json instead of the tarball) and failed checksum verification.
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: make check (fmt, vet, lint, unit+race tests, web lint+build)
run: make check
- name: Go Build
run: make build
- name: golangci-lint ratchet (blocking — the baseline is zero)
run: make lint-strict
- name: Studio API offline smoke test
run: ./scripts/e2e_prime_smoke.sh
race-and-coverage:
name: Race detector & coverage floor
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Race tests (pkg/...)
run: make race
# A full run has parallel workers and background probes emitting while
# the run goroutine rewrites session state. No pkg/... test starts one,
# which is why a currentTurn race survived `make race` indefinitely.
- name: Race tests (integration suite)
run: make race-e2e
- name: Coverage floor
run: make cover
web-check:
name: Web Frontend Check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
# `make web-deps`, not a bare `npm ci`: `npm ci` refuses to run at all when
# web/package-lock.json does not match web/package.json, and the lock in this
# tree predates the vitest/eslint devDependencies. web-deps tries `npm ci`
# first and falls back to `npm install`, printing the real fix either way.
- name: Install web deps
run: make web-deps
- name: Type check
run: cd web && npx tsc --noEmit
- name: Build web
run: cd web && npm run build
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
# `make web-deps`, not a bare `npm ci`: `npm ci` refuses to run at all when
# web/package-lock.json does not match web/package.json, and the lock in this
# tree predates the vitest/eslint devDependencies. web-deps tries `npm ci`
# first and falls back to `npm install`, printing the real fix either way.
- name: Install web deps
run: make web-deps
- name: Build web UI into the go:embed directory
run: make ui-react
- name: Install golangci-lint
# `go install` (not the release install.sh + prebuilt binary) so the
# linter is always built with the SAME Go toolchain this job just set
# up — golangci-lint refuses to run when built with an older Go than
# the module it's targeting, so a prebuilt binary silently breaks
# every time the pinned toolchain in go.mod moves past it. install.sh
# also matched the wrong release asset for v2.13.1 (grabbed the
# .sbom.json instead of the tarball) and failed checksum verification.
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Run pre-commit
uses: pre-commit/action@v3.0.1