-
-
Notifications
You must be signed in to change notification settings - Fork 3k
320 lines (251 loc) · 8.82 KB
/
build.yml
File metadata and controls
320 lines (251 loc) · 8.82 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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: Verify
env:
NODE_VERSION: 24
PNPM_VERSION: 11.2.2
PNPM_STORE_DIR: .pnpm-store
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
- next
- release/*
pull_request:
branches:
- main
- next
- release/*
jobs:
install-node-dependencies:
name: Install node dependencies
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Install dependencies
run: pnpm install --frozen-lockfile --strict-peer-dependencies
- name: Pack dependency artifacts
run: |
tar -czf /tmp/pnpm-store.tar.gz ${{ env.PNPM_STORE_DIR }}
- name: Upload dependency artifacts
uses: actions/upload-artifact@v7
with:
name: node-dependencies
path: |
/tmp/pnpm-store.tar.gz
retention-days: 1
check-linting-formatting:
name: Check linting & formatting
runs-on: ubuntu-latest
needs: build-packages
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Download dependency artifacts
uses: actions/download-artifact@v8
with:
name: node-dependencies
path: /tmp/node-dependencies
- name: Restore pnpm store
run: tar -xzf /tmp/node-dependencies/pnpm-store.tar.gz
- name: Restore dependencies
run: pnpm install --offline --frozen-lockfile --strict-peer-dependencies
- name: Run linting and formatting checks
run: pnpm run lint
build-packages:
name: Build packages
runs-on: ubuntu-latest
needs: install-node-dependencies
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Download dependency artifacts
uses: actions/download-artifact@v8
with:
name: node-dependencies
path: /tmp/node-dependencies
- name: Restore pnpm store
run: tar -xzf /tmp/node-dependencies/pnpm-store.tar.gz
- name: Restore dependencies
run: pnpm install --offline --frozen-lockfile --strict-peer-dependencies
- name: Build packages
run: pnpm run build && pnpm run build:demos
- name: Pack build artifacts
run: tar -czf /tmp/build-output.tar.gz packages/*/dist packages-deprecated/*/dist demos/dist
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: /tmp/build-output.tar.gz
retention-days: 1
run-unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
needs: build-packages
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Download dependency artifacts
uses: actions/download-artifact@v8
with:
name: node-dependencies
path: /tmp/node-dependencies
- name: Restore pnpm store
run: tar -xzf /tmp/node-dependencies/pnpm-store.tar.gz
- name: Restore dependencies
run: pnpm install --offline --frozen-lockfile --strict-peer-dependencies
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-output
path: /tmp/build-output
- name: Restore build output
run: tar -xzf /tmp/build-output/build-output.tar.gz
- name: Run unit tests
run: pnpm run test:unit
run-e2e-tests:
name: Run e2e tests (shard ${{ matrix.shard }}/${{ matrix.total }})
runs-on: ubuntu-latest
needs: build-packages
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
total: [4]
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Download dependency artifacts
uses: actions/download-artifact@v8
with:
name: node-dependencies
path: /tmp/node-dependencies
- name: Restore pnpm store
run: tar -xzf /tmp/node-dependencies/pnpm-store.tar.gz
- name: Restore dependencies
run: pnpm install --offline --frozen-lockfile --strict-peer-dependencies
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-output
path: /tmp/build-output
- name: Restore build output
run: tar -xzf /tmp/build-output/build-output.tar.gz
- name: Get Playwright version
id: playwright-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium
- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium
- name: Run Playwright tests
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shard }}/${{ matrix.total }}
- name: Upload blob report
if: always()
uses: actions/upload-artifact@v7
with:
name: e2e-blob-report-${{ matrix.shard }}
path: blob-report
retention-days: 7
merge-e2e-reports:
name: Merge e2e reports
runs-on: ubuntu-latest
needs: run-e2e-tests
if: always()
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure pnpm store
run: pnpm config set store-dir ${{ github.workspace }}/${{ env.PNPM_STORE_DIR }}
- name: Download dependency artifacts
uses: actions/download-artifact@v8
with:
name: node-dependencies
path: /tmp/node-dependencies
- name: Restore pnpm store
run: tar -xzf /tmp/node-dependencies/pnpm-store.tar.gz
- name: Restore dependencies
run: pnpm install --offline --frozen-lockfile --strict-peer-dependencies
- name: Download blob reports
uses: actions/download-artifact@v8
with:
path: all-blob-reports
pattern: e2e-blob-report-*
merge-multiple: true
- name: Merge into HTML report
if: ${{ hashFiles('all-blob-reports/**') != '' }}
run: pnpm exec playwright merge-reports --reporter html ./all-blob-reports
- name: Upload merged HTML report
uses: actions/upload-artifact@v7
with:
name: playwright-html-report
path: playwright-report
retention-days: 14