-
Notifications
You must be signed in to change notification settings - Fork 1
230 lines (216 loc) · 6.92 KB
/
Copy pathcode-qa.yml
File metadata and controls
230 lines (216 loc) · 6.92 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
# PR quality gate — runs on every pull request targeting main.
# Jobs: lint → types → skills-drift → unit+coverage → bundle-size → e2e-webview → e2e-vscode → pr-title
# All jobs must pass before merge (enforced via branch protection rules).
#
# Conceptually, the per-job step list across this workflow == `pnpm verify:full` from the root.
# CI keeps the split (parallelism + per-job failure attribution); local devs and agents run
# `pnpm verify` (fast lifecycle) and `pnpm verify:full` (CI equivalent) — see AGENTS.md § Verification.
#
# @see docs/specs/500-ci-code-qa/spec.md [FR-1] [FR-2] [FR-3] [FR-4] [FR-5] [FR-6] [FR-7] [FR-8] [FR-9]
# @see docs/specs/500-ci-code-qa/design.md [DES-CI-CODE-QA-JOB-GRAPH]
# @see docs/specs/430-dx-enforcement/430-dx-enforcement.md [FR-1] [FR-2] [DES-ARCH]
name: code-qa
on:
pull_request:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm check:lint
- run: pnpm check:format
- run: pnpm check:md
types:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm check:types
skills-drift:
name: Skills drift
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm --filter "./apps/vscode" sync:skills -- --verify
unit:
name: Unit tests + coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run unit tests via vitest workspace (excludes vscode-e2e)
run: pnpm test:coverage
- uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-report
path: "**/coverage/"
bundle-size:
name: Bundle size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Enforce bundle-size budgets (FR-30)
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: build
e2e-webview:
name: E2E — Sidebar webview (Playwright)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm --filter apps/chat exec playwright install --with-deps chromium
- name: Run Playwright tests
run: pnpm test:e2e
e2e-vscode:
name: E2E — Extension host
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build extension
run: pnpm build:vscode
- name: Run vscode-e2e
uses: coactions/setup-xvfb@v1
with:
run: pnpm test:e2e:vscode
if: runner.os == 'Linux'
- name: Run vscode-e2e (Windows)
run: pnpm test:e2e:vscode
if: runner.os == 'Windows'
pr-title:
name: PR title lint (Conventional Commit)
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: true
validateSingleCommit: false
# @see docs/specs/430-dx-enforcement/430-dx-enforcement.md [FR-15] [DES-SECRETS]
secrets:
name: Secret scan (gitleaks)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # full history for diff scan
- uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITLEAKS_LICENSE only required for org-owned private repos with > $25/seat plan.
# For solo/public repos, leave unset; the action runs in OSS mode.
# @see docs/specs/430-dx-enforcement/430-dx-enforcement.md [FR-16] [FR-18] [DES-SUPPLY] [DES-SEC]
security:
name: Supply chain (audit + licenses)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22.19.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: pnpm audit (high+ on production deps)
run: pnpm audit --audit-level=high --prod
- name: Build shipped artifacts for legal inventory
run: pnpm build
- name: Baseline package license policy
run: pnpm exec license-checker-rseidelsohn --production --onlyAllow 'MIT;ISC;Apache-2.0;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-4.0;0BSD;Unlicense;Python-2.0;BlueOak-1.0.0;OFL-1.1'
- name: Artifact-aware third-party notices
run: pnpm legal:check
# @see docs/specs/430-dx-enforcement/430-dx-enforcement.md [FR-17] [DES-SUPPLY]
osv-scan:
name: OSV-Scanner (lockfile vulnerabilities)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: google/osv-scanner-action/osv-scanner-action@v2.3.8
with:
scan-args: |-
--lockfile=pnpm-lock.yaml
# @see docs/specs/430-dx-enforcement/430-dx-enforcement.md [FR-20] [DES-SUPPLY]
actionlint:
name: actionlint (workflow YAML)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: reviewdog/action-actionlint@v1
with:
reporter: github-pr-review
fail_level: error
level: error