Repository navigation
331 lines (273 loc) · 9.14 KB
/
Copy pathmain.yml
File metadata and controls
331 lines (273 loc) · 9.14 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
321
322
323
324
325
326
327
328
329
330
331
name: CI
on:
push:
branches:
- 'master'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
jobs:
packages:
name: check npm install
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: check npm ci
run: npm ci
lint:
name: run lint
runs-on: ubuntu-latest
needs: [packages]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: restore ESLint cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .eslintcache
key: eslint-cache-${{ runner.os }}-${{ hashFiles('eslint.config.mjs', '.eslintignore', 'package-lock.json') }}
restore-keys: |
eslint-cache-${{ runner.os }}-
- name: npm ci
run: npm ci
- name: run lint
run: npm run lint:no-fix -- --max-warnings=0
format:
name: run format
runs-on: ubuntu-latest
needs: [packages]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: npm ci
run: npm ci
- name: restore Prettier cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: node_modules/.cache/prettier
key: prettier-cache-${{ runner.os }}-${{ hashFiles('.prettierrc', '.prettierignore', 'package-lock.json') }}
restore-keys: |
prettier-cache-${{ runner.os }}-
- name: run format
run: npx prettier --cache --check .
type-check:
name: run type-check
runs-on: ubuntu-latest
needs: [packages]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: npm ci
run: npm ci
- name: run type-check
run: npm run type-check
build:
name: run build
runs-on: ubuntu-latest
needs: [packages]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ./public/fonts
key: font-build-${{ runner.os }}
restore-keys: |
font-build-${{ runner.os }}
- name: npm ci
run: npm ci
- name: run build
run: npm run build:may-with-font
- name: run storybook:build
run: npm run storybook:build
test-unit:
name: run test:unit
runs-on: ubuntu-latest
needs: [packages]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: npm ci
run: npm ci
- name: run test:unit
run: npm run test:unit
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage
path: ./coverage
codecov:
name: Upload coverage to Codecov
runs-on: ubuntu-latest
needs: [test-unit]
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: coverage
path: ./coverage
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-e2e-virtual-scroll:
name: virtual scroll E2E (${{ matrix.os }}, ${{ matrix.project || matrix.browser }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
browser: chromium
- os: ubuntu-latest
browser: firefox
- os: ubuntu-latest
browser: webkit
- os: windows-latest
browser: chromium
- os: windows-latest
browser: firefox
- os: macos-latest
browser: chromium
- os: macos-latest
browser: firefox
- os: macos-latest
browser: webkit
- os: ubuntu-latest
browser: chromium
project: mobile-chromium
- os: macos-latest
browser: webkit
project: mobile-webkit
- os: macos-latest
browser: webkit
project: tablet-webkit
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- name: npm ci
run: npm ci
- name: install Playwright browser
if: ${{ runner.os != 'Windows' || matrix.browser != 'chromium' }}
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: install Chromium headless shell on Windows
if: ${{ runner.os == 'Windows' && matrix.browser == 'chromium' }}
run: npx playwright install --only-shell chromium
- name: check Chromium launch on Windows
id: chromium-launch
if: ${{ runner.os == 'Windows' && matrix.browser == 'chromium' }}
continue-on-error: true
timeout-minutes: 1
shell: pwsh
run: |
@'
import { chromium } from '@playwright/test'
const browser = await chromium.launch({ timeout: 10_000 })
try {
const page = await browser.newPage()
await page.evaluate(() => document.readyState)
} finally {
await browser.close()
}
'@ | node --input-type=module
- name: install Chromium system dependencies on Windows
if: ${{ steps.chromium-launch.outcome == 'failure' }}
run: npx playwright install-deps chromium
- name: run virtual scroll E2E
run: npm run test:e2e-virtual-scroll -- --project=${{ matrix.project || matrix.browser }}
- name: upload virtual scroll E2E failure artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ failure() }}
with:
name: virtual-scroll-e2e-${{ matrix.os }}-${{ matrix.project || matrix.browser }}
path: |
./tests/e2e/results/virtual-scroll
./tests/e2e/report/virtual-scroll
test-e2e:
name: run test:e2e
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ./.node-version
cache: npm
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ./public/fonts
key: font-build-${{ runner.os }}
restore-keys: |
font-build-${{ runner.os }}
- name: npm ci
run: npm ci
- name: install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: run test:e2e
run: npm run test:e2e-headless
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: playwright-results
path: |
./tests/e2e/results
./tests/e2e/report
./tests/e2e/logs
if: ${{ failure() }}