Skip to content

Commit 398eec2

Browse files
[core] Use Circle CI context
Same as mui/material-ui#41532
1 parent 0dc4191 commit 398eec2

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

.circleci/config.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ parameters:
1818
type: string
1919
default: ''
2020

21-
defaults: &defaults
21+
default-job: &default-job
2222
parameters:
2323
react-dist-tag:
2424
description: The dist-tag of react to be used
@@ -46,6 +46,10 @@ defaults: &defaults
4646
# restore_cache:
4747
# key: v1-repo-{{ .Branch }}-{{ .Revision }}
4848

49+
default-context: &default-context
50+
context:
51+
- org-global
52+
4953
commands:
5054
install_js:
5155
parameters:
@@ -114,7 +118,7 @@ commands:
114118

115119
jobs:
116120
checkout:
117-
<<: *defaults
121+
<<: *default-job
118122
steps:
119123
- checkout
120124
- install_js
@@ -125,7 +129,7 @@ jobs:
125129
name: Check for duplicated packages
126130
command: yarn deduplicate
127131
test_unit:
128-
<<: *defaults
132+
<<: *default-job
129133
steps:
130134
- checkout
131135
- install_js
@@ -149,7 +153,7 @@ jobs:
149153
chmod +x codecov
150154
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_DIST_TAG-jsdom"
151155
test_lint:
152-
<<: *defaults
156+
<<: *default-job
153157
steps:
154158
- checkout
155159
- install_js
@@ -163,7 +167,7 @@ jobs:
163167
name: Lint Markdown
164168
command: yarn markdownlint
165169
test_static:
166-
<<: *defaults
170+
<<: *default-job
167171
steps:
168172
- checkout
169173
- install_js
@@ -194,7 +198,7 @@ jobs:
194198
yarn docs:link-check
195199
git add -A && git diff --exit-code --staged
196200
test_browser:
197-
<<: *defaults
201+
<<: *default-job
198202
docker:
199203
- image: mcr.microsoft.com/playwright:v1.41.2-focal
200204
environment:
@@ -211,7 +215,7 @@ jobs:
211215
path: /tmp/_karma_webpack_
212216
destination: artifact-file
213217
test_types:
214-
<<: *defaults
218+
<<: *default-job
215219
steps:
216220
- checkout
217221
- install_js
@@ -227,7 +231,7 @@ jobs:
227231
environment:
228232
NODE_OPTIONS: --max-old-space-size=3072
229233
test_e2e:
230-
<<: *defaults
234+
<<: *default-job
231235
docker:
232236
- image: mcr.microsoft.com/playwright:v1.41.2-focal
233237
environment:
@@ -240,7 +244,7 @@ jobs:
240244
name: Run e2e tests
241245
command: yarn test:e2e
242246
test_e2e_website:
243-
<<: *defaults
247+
<<: *default-job
244248
docker:
245249
- image: mcr.microsoft.com/playwright:v1.41.2-focal
246250
environment:
@@ -255,7 +259,7 @@ jobs:
255259
environment:
256260
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
257261
test_regressions:
258-
<<: *defaults
262+
<<: *default-job
259263
docker:
260264
- image: mcr.microsoft.com/playwright:v1.41.2-focal
261265
environment:
@@ -271,7 +275,7 @@ jobs:
271275
name: Upload screenshots to Argos CI
272276
command: yarn test:argos
273277
run_danger:
274-
<<: *defaults
278+
<<: *default-job
275279
docker:
276280
- image: mcr.microsoft.com/playwright:v1.41.2-focal
277281
environment:
@@ -291,36 +295,46 @@ workflows:
291295
when:
292296
equal: [pipeline, << pipeline.parameters.workflow >>]
293297
jobs:
294-
- checkout
298+
- checkout:
299+
<<: *default-context
295300
- test_unit:
301+
<<: *default-context
296302
requires:
297303
- checkout
298304
- test_lint:
305+
<<: *default-context
299306
requires:
300307
- checkout
301308
- test_static:
309+
<<: *default-context
302310
requires:
303311
- checkout
304312
- test_browser:
313+
<<: *default-context
305314
requires:
306315
- checkout
307316
- test_types:
317+
<<: *default-context
308318
requires:
309319
- checkout
310320
- test_e2e:
321+
<<: *default-context
311322
requires:
312323
- checkout
313324
- test_regressions:
325+
<<: *default-context
314326
requires:
315327
- checkout
316328
- run_danger:
329+
<<: *default-context
317330
requires:
318331
- checkout
319332
e2e-website:
320333
when:
321334
equal: [e2e-website, << pipeline.parameters.workflow >>]
322335
jobs:
323-
- checkout
336+
- checkout:
337+
<<: *default-context
324338
- test_e2e_website:
325339
requires:
326340
- checkout

0 commit comments

Comments
 (0)