-
Notifications
You must be signed in to change notification settings - Fork 0
282 lines (229 loc) · 7.77 KB
/
Copy pathgovernance.yml
File metadata and controls
282 lines (229 loc) · 7.77 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: Governance
on:
push:
branches: [main]
paths:
- 'website/**'
- 'pkg/**'
- 'internal/**'
- 'cmd/**'
- 'tests/**'
- '.github/workflows/governance.yml'
- 'docs/adr/ADR-0016-direction-a-governance.md'
- 'docs/standards/maintenance.md'
- 'docs/CONSTRAINTS.md'
workflow_dispatch:
permissions:
contents: read
# Soft-fail strategy: a11y/lighthouse/godoc warnings do not block CI.
# Only the perf-budget job is hard-failing (hard budget threshold).
concurrency:
group: governance
cancel-in-progress: true
jobs:
# ---- Hard gate: bundle size budget. Block merge on fail. ----
perf-budget:
name: Perf budget (initial JS <= 200KB gz)
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install deps
run: npm install --no-audit --no-fund
- name: Build (Next export)
run: npm run build
- name: Run perf budget
run: node scripts/perf-budget.mjs
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: perf-budget
path: ${{ github.workspace }}/website/.perf-budget.json
retention-days: 14
# ---- Soft gate: Lighthouse audit (homepage categories). ----
lighthouse:
name: Lighthouse CI (perf/a11y/bp/seo)
runs-on: ubuntu-latest
needs: perf-budget
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install deps
run: npm install --no-audit --no-fund
- name: Build (Next export)
run: npm run build
- name: Serve static export
working-directory: website
run: python3 -m http.server 3000 --directory ./out &
shell: bash
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v9
with:
configPath: website/.lighthouserc.cjs
uploadArtifacts: false
temporaryPublicStorage: true
# ---- Soft gate: axe-core a11y across 9 locales. ----
a11y:
name: axe-core a11y (9 locales)
runs-on: ubuntu-latest
needs: perf-budget
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install test deps
working-directory: tests
run: npm install --no-audit --no-fund
- name: Install Chromium for Playwright
working-directory: tests
run: npx playwright install --with-deps chromium
- name: Build (Next export)
working-directory: website
run: npm install --no-audit --no-fund && npm run build
- name: Run axe a11y
working-directory: tests
run: npm run test:a11y
env:
WEBSITE_OUT_DIR: ${{ github.workspace }}/website/out
- name: Upload a11y logs
if: always()
uses: actions/upload-artifact@v4
with:
name: a11y-logs
path: ${{ github.workspace }}/tests/test-results/
retention-days: 14
# ---- Soft gate: end-to-end RAG + memory demo through Director. ----
rag-demo:
name: RAG + memory demo (Director end-to-end)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Build CLI
run: go build ./cmd/aicodingagentteam/...
- name: Run knowledge demo
run: go run ./cmd/aicodingagentteam knowledge demo
- name: Upload demo report
if: always()
uses: actions/upload-artifact@v4
with:
name: rag-demo
path: |
.aicodingagentteam/demo-report.md
.aicodingagentteam/demo-report.json
retention-days: 14
# ---- Soft gate: real host driver end-to-end (codex stub binary, no API key). ----
host-e2e:
name: Host driver e2e (codex stub binary)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Make stub binary executable
run: chmod +x testdata/stubbin/codex
- name: Build CLI
run: go build ./cmd/aicodingagentteam/...
- name: Run host driver e2e tests
run: go test ./internal/scheduler/... -run "TestScheduler_HostE2E" -v
- name: Upload host artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: host-e2e
path: |
.aicodingagentteam/host/
retention-days: 14
if-no-files-found: ignore
# ---- Soft gate: regenerate Go API docs and upload artifact. ----
godocgen:
name: Go public API docs (godocgen)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Generate godoc (9 locales)
run: go run ./cmd/godocgen --locale=en,zh,ja,ko,fr,de,ru,es,it --version=${{ github.sha }}
- name: Smoke test (9 locale indexes exist)
run: |
for locale in en zh ja ko fr de ru es it; do
test -f "website/content/docs/api/$locale/index.md"
done
- name: Upload godoc artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: godocgen
path: ${{ github.workspace }}/website/content/docs/api/
retention-days: 14
# ---- Soft gate: CLI smoke tests for cmd/aicodingagentteam + cmd/godocgen. ----
cli-smoke:
name: CLI smoke (cmd/aicodingagentteam + cmd/godocgen)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Build CLI binaries
run: |
go build ./cmd/aicodingagentteam/...
go build ./cmd/godocgen/...
- name: CLI smoke -- version subcommand
run: go run ./cmd/aicodingagentteam version
- name: CLI smoke -- knowledge demo
run: go run ./cmd/aicodingagentteam knowledge demo
- name: CLI smoke -- godocgen (en)
run: go run ./cmd/godocgen --locale=en --version=test
- name: Run unit tests for cmd packages
run: go test ./cmd/... -cover
- name: Upload smoke logs
if: always()
uses: actions/upload-artifact@v4
with:
name: cli-smoke
path: |
.aicodingagentteam/demo-report.md
.aicodingagentteam/demo-report.json
retention-days: 14
if-no-files-found: ignore
# ---- Summary job: aggregates results in the GitHub Actions UI. ----
summary:
name: Governance summary
runs-on: ubuntu-latest
needs: [perf-budget, lighthouse, a11y, rag-demo, host-e2e, godocgen, cli-smoke]
if: always()
steps:
- name: Summarize
run: |
echo "### Governance results" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- perf-budget: ${{ needs.perf-budget.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- lighthouse: ${{ needs.lighthouse.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- a11y: ${{ needs.a11y.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- godocgen: ${{ needs.godocgen.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- host-e2e: ${{ needs.host-e2e.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- rag-demo: ${{ needs.rag-demo.result }}" >> "$GITHUB_STEP_SUMMARY"
echo "- cli-smoke: ${{ needs.cli-smoke.result }}" >> "$GITHUB_STEP_SUMMARY"