Skip to content

Commit 32c22e9

Browse files
[core] Use Circle CI context (#41532)
1 parent b579513 commit 32c22e9

File tree

1 file changed

+64
-29
lines changed

1 file changed

+64
-29
lines changed

Diff for: .circleci/config.yml

+64-29
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ parameters:
2121
type: string
2222
default: ''
2323

24-
defaults: &defaults
24+
default-job: &default-job
2525
parameters:
2626
react-version:
2727
description: The version of react to be used
@@ -47,6 +47,10 @@ defaults: &defaults
4747
docker:
4848
- image: cimg/node:18.19
4949

50+
default-context: &default-context
51+
context:
52+
- org-global
53+
5054
# CircleCI has disabled the cache across forks for security reasons.
5155
# Following their official statement, it was a quick solution, they
5256
# are working on providing this feature back with appropriate security measures.
@@ -113,7 +117,7 @@ commands:
113117

114118
jobs:
115119
checkout:
116-
<<: *defaults
120+
<<: *default-job
117121
steps:
118122
- checkout
119123
- install_js
@@ -135,7 +139,7 @@ jobs:
135139
pnpm dedupe --check
136140
fi
137141
test_unit:
138-
<<: *defaults
142+
<<: *default-job
139143
steps:
140144
- checkout
141145
- install_js
@@ -187,7 +191,7 @@ jobs:
187191
chmod +x codecov
188192
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_VERSION-jsdom"
189193
test_lint:
190-
<<: *defaults
194+
<<: *default-job
191195
steps:
192196
- checkout
193197
- install_js
@@ -204,7 +208,7 @@ jobs:
204208
name: Lint Markdown
205209
command: pnpm markdownlint
206210
test_static:
207-
<<: *defaults
211+
<<: *default-job
208212
steps:
209213
- checkout
210214
- install_js
@@ -246,7 +250,7 @@ jobs:
246250
pnpm docs:link-check
247251
git add -A && git diff --exit-code --staged
248252
test_types:
249-
<<: *defaults
253+
<<: *default-job
250254
resource_class: 'medium+'
251255
steps:
252256
- checkout
@@ -288,7 +292,7 @@ jobs:
288292
- packages/mui-lab/build
289293
- packages/mui-utils/build
290294
test_types_next:
291-
<<: *defaults
295+
<<: *default-job
292296
resource_class: 'medium+'
293297
steps:
294298
- checkout
@@ -335,7 +339,7 @@ jobs:
335339
node scripts/testBuiltTypes.mjs
336340
exit 0
337341
test_browser:
338-
<<: *defaults
342+
<<: *default-job
339343
resource_class: 'medium+'
340344
docker:
341345
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -366,7 +370,7 @@ jobs:
366370
path: /tmp/_karma_webpack_
367371
destination: artifact-file
368372
test_e2e:
369-
<<: *defaults
373+
<<: *default-job
370374
docker:
371375
- image: mcr.microsoft.com/playwright:v1.42.1-focal
372376
environment:
@@ -386,7 +390,7 @@ jobs:
386390
command: pnpm test:umd
387391
test_e2e_website:
388392
# NOTE: This workflow runs after successful docs deploy. See /test/e2e-website/README.md#ci
389-
<<: *defaults
393+
<<: *default-job
390394
docker:
391395
- image: mcr.microsoft.com/playwright:v1.42.1-focal
392396
environment:
@@ -401,7 +405,7 @@ jobs:
401405
environment:
402406
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
403407
test_profile:
404-
<<: *defaults
408+
<<: *default-job
405409
docker:
406410
- image: mcr.microsoft.com/playwright:v1.42.1-focal
407411
environment:
@@ -428,7 +432,7 @@ jobs:
428432
path: tmp/react-profiler-report/karma
429433
destination: react-profiler-report/karma
430434
test_regressions:
431-
<<: *defaults
435+
<<: *default-job
432436
docker:
433437
- image: mcr.microsoft.com/playwright:v1.42.1-focal
434438
environment:
@@ -444,7 +448,7 @@ jobs:
444448
name: Upload screenshots to Argos CI
445449
command: pnpm test:argos
446450
test_bundling_prepare:
447-
<<: *defaults
451+
<<: *default-job
448452
steps:
449453
- checkout
450454
- install_js
@@ -457,7 +461,7 @@ jobs:
457461
- '*/build'
458462

459463
test_bundling_node-esm:
460-
<<: *defaults
464+
<<: *default-job
461465
working_directory: /tmp/material-ui/test/bundling/fixtures/node-esm/
462466
steps:
463467
- checkout:
@@ -481,7 +485,7 @@ jobs:
481485
pnpm start
482486
exit 0
483487
test_bundling_next-webpack4:
484-
<<: *defaults
488+
<<: *default-job
485489
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/
486490
docker:
487491
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -505,7 +509,7 @@ jobs:
505509
name: Test fixture
506510
command: pnpm start
507511
test_bundling_next-webpack5:
508-
<<: *defaults
512+
<<: *default-job
509513
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/
510514
docker:
511515
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -529,7 +533,7 @@ jobs:
529533
name: Test fixture
530534
command: pnpm start
531535
test_bundling_create-react-app:
532-
<<: *defaults
536+
<<: *default-job
533537
working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/
534538
docker:
535539
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -553,7 +557,7 @@ jobs:
553557
name: Test fixture
554558
command: pnpm start
555559
test_bundling_snowpack:
556-
<<: *defaults
560+
<<: *default-job
557561
working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/
558562
docker:
559563
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -577,7 +581,7 @@ jobs:
577581
name: Test fixture
578582
command: pnpm start
579583
test_bundling_vite:
580-
<<: *defaults
584+
<<: *default-job
581585
working_directory: /tmp/material-ui/test/bundling/fixtures/vite/
582586
docker:
583587
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -601,7 +605,7 @@ jobs:
601605
name: Test fixture
602606
command: pnpm start
603607
test_bundling_esbuild:
604-
<<: *defaults
608+
<<: *default-job
605609
working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/
606610
docker:
607611
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -629,7 +633,7 @@ jobs:
629633
pnpm start
630634
exit 0
631635
test_bundling_gatsby:
632-
<<: *defaults
636+
<<: *default-job
633637
working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/
634638
docker:
635639
- image: mcr.microsoft.com/playwright:v1.42.1-focal
@@ -652,7 +656,7 @@ jobs:
652656
name: Test fixture
653657
command: pnpm start
654658
test_bundle_size_monitor:
655-
<<: *defaults
659+
<<: *default-job
656660
steps:
657661
- checkout
658662
- install_js
@@ -731,7 +735,7 @@ jobs:
731735
environment:
732736
DANGER_COMMAND: 'reportBundleSize'
733737
test_benchmark:
734-
<<: *defaults
738+
<<: *default-job
735739
docker:
736740
- image: mcr.microsoft.com/playwright:v1.42.1-focal
737741
environment:
@@ -751,74 +755,95 @@ workflows:
751755
when:
752756
equal: [pipeline, << pipeline.parameters.workflow >>]
753757
jobs:
754-
- checkout
758+
- checkout:
759+
<<: *default-context
755760
- test_unit:
761+
<<: *default-context
756762
requires:
757763
- checkout
758764
- test_lint:
765+
<<: *default-context
759766
requires:
760767
- checkout
761768
- test_static:
769+
<<: *default-context
762770
requires:
763771
- checkout
764772
- test_types:
773+
<<: *default-context
765774
requires:
766775
- checkout
767776
- test_browser:
777+
<<: *default-context
768778
requires:
769779
- checkout
770780
- test_regressions:
781+
<<: *default-context
771782
requires:
772783
- checkout
773784
- test_e2e:
785+
<<: *default-context
774786
requires:
775787
- checkout
776788
- test_bundle_size_monitor:
789+
<<: *default-context
777790
requires:
778791
- checkout
779792
e2e-website:
780793
when:
781794
equal: [e2e-website, << pipeline.parameters.workflow >>]
782795
jobs:
783-
- checkout
796+
- checkout:
797+
<<: *default-context
784798
- test_e2e_website:
799+
<<: *default-context
785800
requires:
786801
- checkout
787802

788803
bundling:
789804
when:
790805
equal: [bundling, << pipeline.parameters.workflow >>]
791806
jobs:
792-
- test_bundling_prepare
807+
- test_bundling_prepare:
808+
<<: *default-context
793809
- test_bundling_node-esm:
810+
<<: *default-context
794811
requires:
795812
- test_bundling_prepare
796813
- test_bundling_next-webpack4:
814+
<<: *default-context
797815
requires:
798816
- test_bundling_prepare
799817
- test_bundling_next-webpack5:
818+
<<: *default-context
800819
requires:
801820
- test_bundling_prepare
802821
- test_bundling_create-react-app:
822+
<<: *default-context
803823
requires:
804824
- test_bundling_prepare
805825
- test_bundling_snowpack:
826+
<<: *default-context
806827
requires:
807828
- test_bundling_prepare
808829
- test_bundling_vite:
830+
<<: *default-context
809831
requires:
810832
- test_bundling_prepare
811833
- test_bundling_esbuild:
834+
<<: *default-context
812835
requires:
813836
- test_bundling_prepare
814837
- test_bundling_gatsby:
838+
<<: *default-context
815839
requires:
816840
- test_bundling_prepare
817841
profile:
818842
when:
819843
equal: [profile, << pipeline.parameters.workflow >>]
820844
jobs:
821-
- test_profile
845+
- test_profile:
846+
<<: *default-context
822847
react-17:
823848
triggers:
824849
- schedule:
@@ -829,12 +854,16 @@ workflows:
829854
- master
830855
jobs:
831856
- test_unit:
857+
<<: *default-context
832858
react-version: ^17.0.0
833859
- test_browser:
860+
<<: *default-context
834861
react-version: ^17.0.0
835862
- test_regressions:
863+
<<: *default-context
836864
react-version: ^17.0.0
837865
- test_e2e:
866+
<<: *default-context
838867
react-version: ^17.0.0
839868
react-next:
840869
triggers:
@@ -846,12 +875,16 @@ workflows:
846875
- master
847876
jobs:
848877
- test_unit:
878+
<<: *default-context
849879
react-version: next
850880
- test_browser:
881+
<<: *default-context
851882
react-version: next
852883
- test_regressions:
884+
<<: *default-context
853885
react-version: next
854886
- test_e2e:
887+
<<: *default-context
855888
react-version: next
856889
typescript-next:
857890
triggers:
@@ -862,9 +895,11 @@ workflows:
862895
only:
863896
- master
864897
jobs:
865-
- test_types_next
898+
- test_types_next:
899+
<<: *default-context
866900
benchmark:
867901
when:
868902
equal: [benchmark, << pipeline.parameters.workflow >>]
869903
jobs:
870-
- test_benchmark
904+
- test_benchmark:
905+
<<: *default-context

0 commit comments

Comments
 (0)