From 25e701b61899dd26eec296acb01247899efc7fa1 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 17 Mar 2024 17:31:07 +0100 Subject: [PATCH] [core] Use Circle CI context Same as https://github.com/mui/material-ui/pull/41532 --- .circleci/config.yml | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 200f447444cb4..9936d6febdf72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ parameters: type: string default: '' -defaults: &defaults +default-job: &default-job parameters: react-dist-tag: description: The dist-tag of react to be used @@ -46,6 +46,10 @@ defaults: &defaults # restore_cache: # key: v1-repo-{{ .Branch }}-{{ .Revision }} +default-context: &default-context + context: + - org-global + commands: install_js: parameters: @@ -114,7 +118,7 @@ commands: jobs: checkout: - <<: *defaults + <<: *default-job steps: - checkout - install_js @@ -125,7 +129,7 @@ jobs: name: Check for duplicated packages command: yarn deduplicate test_unit: - <<: *defaults + <<: *default-job steps: - checkout - install_js @@ -149,7 +153,7 @@ jobs: chmod +x codecov ./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_DIST_TAG-jsdom" test_lint: - <<: *defaults + <<: *default-job steps: - checkout - install_js @@ -163,7 +167,7 @@ jobs: name: Lint Markdown command: yarn markdownlint test_static: - <<: *defaults + <<: *default-job steps: - checkout - install_js @@ -194,7 +198,7 @@ jobs: yarn docs:link-check git add -A && git diff --exit-code --staged test_browser: - <<: *defaults + <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.41.2-focal environment: @@ -211,7 +215,7 @@ jobs: path: /tmp/_karma_webpack_ destination: artifact-file test_types: - <<: *defaults + <<: *default-job steps: - checkout - install_js @@ -227,7 +231,7 @@ jobs: environment: NODE_OPTIONS: --max-old-space-size=3072 test_e2e: - <<: *defaults + <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.41.2-focal environment: @@ -240,7 +244,7 @@ jobs: name: Run e2e tests command: yarn test:e2e test_e2e_website: - <<: *defaults + <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.41.2-focal environment: @@ -255,7 +259,7 @@ jobs: environment: PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >> test_regressions: - <<: *defaults + <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.41.2-focal environment: @@ -271,7 +275,7 @@ jobs: name: Upload screenshots to Argos CI command: yarn test:argos run_danger: - <<: *defaults + <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.41.2-focal environment: @@ -291,36 +295,46 @@ workflows: when: equal: [pipeline, << pipeline.parameters.workflow >>] jobs: - - checkout + - checkout: + <<: *default-context - test_unit: + <<: *default-context requires: - checkout - test_lint: + <<: *default-context requires: - checkout - test_static: + <<: *default-context requires: - checkout - test_browser: + <<: *default-context requires: - checkout - test_types: + <<: *default-context requires: - checkout - test_e2e: + <<: *default-context requires: - checkout - test_regressions: + <<: *default-context requires: - checkout - run_danger: + <<: *default-context requires: - checkout e2e-website: when: equal: [e2e-website, << pipeline.parameters.workflow >>] jobs: - - checkout + - checkout: + <<: *default-context - test_e2e_website: requires: - checkout