-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Expand file tree
/
Copy pathconfig.yml
More file actions
711 lines (695 loc) · 20.8 KB
/
config.yml
File metadata and controls
711 lines (695 loc) · 20.8 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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
version: 2.1
orbs:
code-infra: https://raw.githubusercontent.com/mui/mui-public/12844f2b6b11babab17bd3d1f799359ea25d1db7/.circleci/orbs/code-infra.yml
aws-cli: circleci/aws-cli@5.4.1
aws-s3: circleci/aws-s3@4.1.3
parameters:
workflow:
description: The name of the workflow to run
type: string
default: pipeline
e2e-base-url:
description: The base url for running end-to-end test
type: string
default: ''
default-job: &default-job
parameters:
react-version:
description: The version of react to be used
type: string
default: stable
typescript-version:
description: The version of typescript to be used
type: string
default: stable
e2e-base-url:
description: The base url for running end-to-end test
type: string
default: << pipeline.parameters.e2e-base-url >>
environment:
AWS_REGION_ARTIFACTS: eu-central-1
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'
DANGER_DISABLE_TRANSPILATION: 'true'
working_directory: /tmp/material-ui
executor:
name: code-infra/mui-node
node-version: '22.18'
default-context: &default-context
context:
- org-global
# CircleCI has disabled the cache across forks for security reasons.
# Following their official statement, it was a quick solution, they
# are working on providing this feature back with appropriate security measures.
# https://discuss.circleci.com/t/saving-cache-stopped-working-warning-skipping-this-step-disabled-in-configuration/24423/21
#
# restore_repo: &restore_repo
# restore_cache:
# key: v1-repo-{{ .Branch }}-{{ .Revision }}
commands:
install-deps:
parameters:
ignore-workspace:
type: boolean
default: false
react-version:
type: string
default: stable
typescript-version:
type: string
default: stable
playwright-version:
type: string
default: stable
steps:
- code-infra/install-deps:
package-overrides: react@<< parameters.react-version >> typescript@<< parameters.typescript-version >> @playwright/test@<< parameters.playwright-version >> playwright@<< parameters.playwright-version >>
ignore-workspace: << parameters.ignore-workspace >>
jobs:
test_unit:
<<: *default-job
steps:
- checkout
- install-deps:
react-version: << parameters.react-version >>
- run:
name: Tests fake browser
command: pnpm test:node --no-isolate --no-file-parallelism
- run:
name: internal-scripts
command: |
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)
# latest commit where internal-scripts was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff packages-internal/scripts)
if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
pnpm --filter @mui/internal-scripts test
else
echo "no changes"
fi
- store_test_results:
path: test-results
test_lint:
<<: *default-job
steps:
- checkout
- install-deps
- code-infra/eslint
- code-infra/stylelint
- code-infra/markdownlint
- code-infra/valelint
test_static:
<<: *default-job
steps:
- checkout
- install-deps
- code-infra/check-static-changes
- run:
name: Generate PropTypes
command: pnpm proptypes
- run:
name: '`pnpm proptypes` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Generate the documentation
command: pnpm docs:api
- run:
name: '`pnpm docs:api` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: '`pnpm extract-error-codes` changes committed?'
command: |
pnpm extract-error-codes
git add -A && git diff --exit-code --staged
test_types:
<<: *default-job
resource_class: 'medium+'
steps:
- checkout
- install-deps
- run:
name: Transpile TypeScript demos
command: pnpm docs:typescript:formatted
- run:
name: '`pnpm docs:typescript:formatted` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Tests TypeScript definitions
command: pnpm typescript:ci
environment:
NODE_OPTIONS: --max-old-space-size=3072
- run:
name: Test module augmentation
command: pnpm typescript:module-augmentation
test_types_next:
<<: *default-job
resource_class: 'medium+'
steps:
- checkout
- install-deps:
typescript-version: << parameters.typescript-version >>
- run:
name: Tests TypeScript definitions
command: pnpm typescript:ci
environment:
NODE_OPTIONS: --max-old-space-size=3072
- run:
name: Prepare files
# Enable configuration that is only valid in typescript@next
command: sed -i 's|// <ts@next uncomment>||g' test/moduleResolution/tsconfig.node.json
- run:
name: Build declaration files
command: |
pnpm lerna run --scope "@mui/*" build
- run:
name: Log defect declaration files
command: |
node scripts/testBuiltTypes.mjs
test_browser_legacy:
<<: *default-job
resource_class: 'medium+'
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.49.1-noble
steps:
- checkout
- code-infra/install-pnpm
- run:
name: Configure pnpm engine-strict
command: pnpm config set --location project engine-strict false
- install-deps:
react-version: << parameters.react-version >>
playwright-version: '1.49.1'
- run:
name: Tests chromium
command: pnpm test:browser --no-isolate --no-file-parallelism
- run:
name: Tests webkit
environment:
VITEST_BROWSERS: 'webkit'
command: pnpm test:browser --no-isolate --no-file-parallelism
- run:
name: Tests firefox
environment:
VITEST_BROWSERS: 'firefox'
command: pnpm test:browser --no-isolate --no-file-parallelism
- store_test_results:
path: test-results
test_browser:
<<: *default-job
resource_class: 'medium+'
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
steps:
- checkout
- install-deps:
react-version: << parameters.react-version >>
- run:
name: Tests chromium
command: pnpm test:browser --no-isolate --no-file-parallelism
- run:
name: Tests webkit
environment:
VITEST_BROWSERS: 'webkit'
command: pnpm test:browser --no-isolate --no-file-parallelism
- run:
name: Tests firefox
environment:
VITEST_BROWSERS: 'firefox'
command: pnpm test:browser --no-isolate --no-file-parallelism
- store_test_results:
path: test-results
test_e2e:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
steps:
- checkout
- install-deps:
react-version: << parameters.react-version >>
- run:
name: pnpm test:e2e
command: pnpm test:e2e
test_e2e_website:
# NOTE: This workflow runs after successful docs deploy. See /test/e2e-website/README.md#ci
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
steps:
- checkout
- install-deps
- run:
name: pnpm test:e2e-website
command: pnpm test:e2e-website
environment:
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
test_regressions:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
steps:
- checkout
- install-deps:
react-version: << parameters.react-version >>
- run:
name: Run visual regression tests
command: xvfb-run pnpm test:regressions
- run:
name: A11y results committed?
command: git add -A && git diff --exit-code --staged
- run:
name: Build packages for fixtures
command: pnpm release:build
- run:
name: Validate type declarations
command: pnpm validate-declarations
- run:
name: Analyze exported typescript
command: pnpm test:attw
no_output_timeout: 20m
- run:
name: Any defect declaration files?
command: node scripts/testBuiltTypes.mjs
- run:
name: test exported typescript
command: pnpm --filter @mui-internal/test-module-resolution typescript:all
- run:
name: Upload screenshots to Argos CI
command: pnpm test:argos
test_bundling_prepare:
<<: *default-job
steps:
- checkout
- install-deps
- run:
name: Build packages for fixtures
command: pnpm lerna run --scope "@mui/*" build
- run:
name: Pack packages
command: pnpm release:pack
- persist_to_workspace:
root: packed
paths:
- '*'
test_bundling_node_cjs:
<<: *default-job
working_directory: /tmp/material-ui/test/bundling/fixtures/node-cjs/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_node_esm:
<<: *default-job
working_directory: /tmp/material-ui/test/bundling/fixtures/node-esm/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
# TODO: Known failure
command: pnpm start
test_bundling_next_webpack4:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_next_webpack5:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_create_react_app:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_snowpack:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_vite:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/vite/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_esbuild:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.59.1-noble
working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundling_gatsby:
<<: *default-job
executor:
name: code-infra/mui-node-browser
playwright-img-version: v1.59.1-noble
environment:
GATSBY_CPU_COUNT: '3'
working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packed
- install-deps:
ignore-workspace: true
- run:
name: Test fixture
command: pnpm start
test_bundle_size_monitor:
<<: *default-job
steps:
- checkout
- install-deps
- run:
name: Build @mui packages
command: pnpm release:build
# @TODO: Not using code-infra/upload-size-snapshot since it doesn't support setting concurrency yet
- run:
name: Create and upload a size snapshot
command: pnpm size:snapshot --concurrency 6
- store_artifacts:
name: Persist size snapshot as pipeline artifact
path: size-snapshot.json
destination: size-snapshot.json
workflows:
version: 2
pipeline:
when:
equal: [pipeline, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
- test_lint:
<<: *default-context
- test_static:
<<: *default-context
- test_types:
<<: *default-context
- test_browser:
<<: *default-context
- test_browser_legacy:
<<: *default-context
- test_regressions:
<<: *default-context
- test_e2e:
<<: *default-context
- test_bundle_size_monitor:
<<: *default-context
e2e-website:
when:
equal: [e2e-website, << pipeline.parameters.workflow >>]
jobs:
- test_e2e_website:
<<: *default-context
bundling:
when:
equal: [bundling, << pipeline.parameters.workflow >>]
jobs:
- test_bundling_prepare:
<<: *default-context
- test_bundling_node_cjs:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_node_esm:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_create_react_app:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_snowpack:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_vite:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_esbuild:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_gatsby:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_next_webpack4:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_next_webpack5:
<<: *default-context
requires:
- test_bundling_prepare
# This workflow can be triggered manually on the PR
react-17:
when:
equal: [react-17, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
react-version: ^17.0.0
name: test_unit-react@17
- test_browser:
<<: *default-context
react-version: ^17.0.0
name: test_browser-react@17
- test_regressions:
<<: *default-context
react-version: ^17.0.0
name: test_regressions-react@17
- test_e2e:
<<: *default-context
react-version: ^17.0.0
name: test_e2e-react@17
# This workflow is identical to react-17, but scheduled
# TODO: The v17 tests have deteriorated to the point of no return. Fix for v18 once we
# deprecate v17, and reenable this workflow.
# react-17-cron:
# triggers:
# - schedule:
# cron: '0 0 * * *'
# filters:
# branches:
# only:
# - master
# - next
# jobs:
# - test_unit:
# <<: *default-context
# react-version: ^17.0.0
# name: test_unit-react@17
# - test_browser:
# <<: *default-context
# react-version: ^17.0.0
# name: test_browser-react@17
# - test_regressions:
# <<: *default-context
# react-version: ^17.0.0
# name: test_regressions-react@17
# - test_e2e:
# <<: *default-context
# react-version: ^17.0.0
# name: test_e2e-react@17
# This workflow can be triggered manually on the PR
react-18:
when:
equal: [react-18, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
react-version: ^18.0.0
name: test_unit-react@18
- test_browser:
<<: *default-context
react-version: ^18.0.0
name: test_browser-react@18
- test_regressions:
<<: *default-context
react-version: ^18.0.0
name: test_regressions-react@18
- test_e2e:
<<: *default-context
react-version: ^18.0.0
name: test_e2e-react@18
# This workflow is identical to react-18, but scheduled
react-18-cron:
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
# #target-branch-reference
- master
- v5.x
- v6.x
jobs:
- test_unit:
<<: *default-context
react-version: ^18.0.0
name: test_unit-react@18
- test_browser:
<<: *default-context
react-version: ^18.0.0
name: test_browser-react@18
- test_regressions:
<<: *default-context
react-version: ^18.0.0
name: test_regressions-react@18
- test_e2e:
<<: *default-context
react-version: ^18.0.0
name: test_e2e-react@18
# This workflow can be triggered manually on the PR
react-next:
when:
equal: [react-next, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
react-version: next
name: test_unit-react@next
- test_browser:
<<: *default-context
react-version: next
name: test_browser-react@next
- test_regressions:
<<: *default-context
react-version: next
name: test_regressions-react@next
- test_e2e:
<<: *default-context
react-version: next
name: test_e2e-react@next
# This workflow is identical to react-next, but scheduled
react-next-cron:
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
# #target-branch-reference
- master
- v6.x
jobs:
- test_unit:
<<: *default-context
react-version: next
name: test_unit-react@next
- test_browser:
<<: *default-context
react-version: next
name: test_browser-react@next
- test_regressions:
<<: *default-context
react-version: next
name: test_regressions-react@next
- test_e2e:
<<: *default-context
react-version: next
name: test_e2e-react@next
typescript-next:
when:
equal: [typescript-next, << pipeline.parameters.workflow >>]
jobs:
- test_types_next:
<<: *default-context
typescript-version: next
typescript-next-cron:
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
# #target-branch-reference
- master
- v6.x
jobs:
- test_types_next:
<<: *default-context
typescript-version: next