-
Notifications
You must be signed in to change notification settings - Fork 0
238 lines (187 loc) · 7.04 KB
/
Copy pathci.yml
File metadata and controls
238 lines (187 loc) · 7.04 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
name: CI
on:
push:
branches:
- "pras75299/initial-feature-setup"
- "main"
- "chore/**"
- "feat/**"
- "fix/**"
pull_request:
branches:
- "pras75299/initial-feature-setup"
- "main"
jobs:
test-and-lint:
name: Test, Lint & Type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.3.0
- uses: pnpm/action-setup@v5.0.0
with:
version: 10.33.0
- uses: actions/setup-node@v4.0.4
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate changeset summary quality (PR only)
if: github.event_name == 'pull_request'
run: pnpm changeset:quality
- name: Build CLI
run: pnpm --dir packages/cli build
- name: Check CLI ↔ README command drift
run: pnpm check:cli-readme
- name: Check agent instruction pointer drift
run: pnpm check:agent-docs
- name: Run workspace tests
run: pnpm test
- name: Run repo-level tests
run: pnpm -w run test:repo
- name: Lint workspaces
run: pnpm lint
- name: Check dead code
run: pnpm deadcode
- name: Type-check CLI
run: pnpm --dir packages/cli exec tsc --noEmit
- name: Type-check docs site
run: pnpm --dir apps/www exec tsc --noEmit
- name: Verify generated registry artifacts are up to date
shell: bash
run: |
pnpm build:registry
# Bash array keeps word-splitting safe in any shell a maintainer
# might use to reproduce locally (zsh on macOS doesn't word-split
# unquoted vars, so a `$PATHS` variable would pass to git as one
# giant pathspec and silently match nothing).
PATHS=(registry.json apps/www/public/registry.json apps/www/public/registry apps/www/public/r apps/www/components/ui apps/www/config/components.ts apps/www/config/docs-scenarios.ts apps/www/config/demos.tsx)
# 1. Tracked-file drift: any diff in already-committed paths.
git diff --exit-code -- "${PATHS[@]}" || (echo "" && echo "ERROR: generated registry/docs artifacts are out of sync." && echo "Run 'pnpm build:registry' locally and commit the updated generated files." && exit 1)
# 2. Untracked-file drift: build emitted a NEW file (e.g. a new
# component slug → new apps/www/public/r/<slug>.json) that the
# contributor forgot to `git add`. git diff would not catch it.
UNTRACKED=$(git ls-files --others --exclude-standard -- "${PATHS[@]}")
if [ -n "$UNTRACKED" ]; then
echo ""
echo "ERROR: untracked generated registry/docs artifacts detected:"
echo "$UNTRACKED" | sed 's/^/ - /'
echo "Run 'pnpm build:registry' locally and 'git add' the new files."
exit 1
fi
- name: Validate generated registry artifacts (schema)
run: pnpm registry:validate
e2e-smoke:
name: Docs site smoke (Playwright)
runs-on: ubuntu-latest
needs: test-and-lint
steps:
- uses: actions/checkout@v4.3.0
- uses: pnpm/action-setup@v5.0.0
with:
version: 10.33.0
- uses: actions/setup-node@v4.0.4
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('apps/www/package.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm --dir apps/www test:e2e:install
- name: Install Playwright OS deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: pnpm --dir apps/www exec playwright install-deps chromium
- name: Build docs site
run: pnpm --dir apps/www build
- name: Run Playwright smoke
run: pnpm --dir apps/www test:e2e
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/www/playwright-report
retention-days: 7
e2e-a11y:
name: Docs site a11y (axe-core)
runs-on: ubuntu-latest
needs: test-and-lint
steps:
- uses: actions/checkout@v4.3.0
- uses: pnpm/action-setup@v5.0.0
with:
version: 10.33.0
- uses: actions/setup-node@v4.0.4
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache-a11y
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('apps/www/package.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache-a11y.outputs.cache-hit != 'true'
run: pnpm --dir apps/www test:e2e:install
- name: Install Playwright OS deps
if: steps.playwright-cache-a11y.outputs.cache-hit == 'true'
run: pnpm --dir apps/www exec playwright install-deps chromium
- name: Build docs site
run: pnpm --dir apps/www build
- name: Run axe a11y audit
run: pnpm --dir apps/www test:e2e:a11y
- name: Upload a11y report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: a11y-report
path: apps/www/playwright-report
retention-days: 7
e2e-perf:
name: Docs site perf budgets (LCP/CLS)
runs-on: ubuntu-latest
needs: test-and-lint
steps:
- uses: actions/checkout@v4.3.0
- uses: pnpm/action-setup@v5.0.0
with:
version: 10.33.0
- uses: actions/setup-node@v4.0.4
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache-perf
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('apps/www/package.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache-perf.outputs.cache-hit != 'true'
run: pnpm --dir apps/www test:e2e:install
- name: Install Playwright OS deps
if: steps.playwright-cache-perf.outputs.cache-hit == 'true'
run: pnpm --dir apps/www exec playwright install-deps chromium
- name: Build docs site
run: pnpm --dir apps/www build
- name: Run perf budget tests
run: pnpm --dir apps/www test:e2e:perf
- name: Upload perf report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: perf-report
path: apps/www/playwright-report
retention-days: 7