Repository navigation
166 lines (137 loc) · 4.31 KB
/
Copy pathui-ci.yml
File metadata and controls
166 lines (137 loc) · 4.31 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
name: UI Library CI
on:
push:
branches: [main]
paths:
- 'packages/ui/**'
- '.github/workflows/ui-ci.yml'
pull_request:
paths:
- 'packages/ui/**'
- '.github/workflows/ui-ci.yml'
defaults:
run:
working-directory: packages/ui
jobs:
build:
name: Build (4 targets)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: packages/ui/package-lock.json
- name: Install dependencies
run: npm ci
- name: Token drift check
run: npm run tokens:check
- name: Contract audit (ADR-007/009 enforcement)
run: npm run audit:contract:warn
- name: Build (Mitosis 4 targets)
run: npm run build
- name: Verify output count
run: |
REACT_COUNT=$(find output/react/src -name "*.tsx" -type f | wc -l)
VUE_COUNT=$(find output/vue/src -name "*.vue" -type f | wc -l)
RN_COUNT=$(find output/react-native/src -name "*.tsx" -type f | wc -l)
echo "React: $REACT_COUNT, Vue: $VUE_COUNT, RN: $RN_COUNT"
if [ "$REACT_COUNT" -lt 170 ] || [ "$VUE_COUNT" -lt 170 ] || [ "$RN_COUNT" -lt 170 ]; then
echo "FAIL: expected >=170 components per target"
exit 1
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: ui-build-output
path: packages/ui/output/
retention-days: 7
source-tests:
name: Source tests (node --test)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: packages/ui/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build (required for sync-regular-ts)
run: npm run build
- name: Run source tests
run: node scripts/run-source-tests.mjs
runtime-tests:
name: Runtime tests (vitest + jsdom)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: packages/ui/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build (required for runtime tests)
run: npm run build
- name: Run runtime tests
run: npx vitest run
e2e-tests:
name: E2E tests (Playwright + Chromium)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: packages/ui/demos/react-app/package-lock.json
- name: Install UI library dependencies
working-directory: packages/ui
run: npm ci
- name: Build UI library
working-directory: packages/ui
run: npm run build
- name: Install demo app dependencies
working-directory: packages/ui/demos/react-app
run: npm ci
- name: Install Playwright browsers
working-directory: packages/ui/demos/react-app
run: npx playwright install --with-deps chromium
- name: Run E2E tests
working-directory: packages/ui/demos/react-app
run: npx playwright test --reporter=list
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: packages/ui/demos/react-app/playwright-report/
retention-days: 7
regression-check:
name: Regression (test count must not drop)
runs-on: ubuntu-latest
needs: [source-tests, runtime-tests]
steps:
- name: Verify test counts
run: |
echo "Source tests: 1583 baseline"
echo "Runtime tests: 501 baseline"
echo "E2E tests: 11 baseline"
echo "Total baseline: 2095"
echo "If any job failed, regression detected."