Skip to content

Commit

Permalink
[core] Use Circle CI context
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 17, 2024
1 parent 0dc4191 commit 398eec2
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -46,6 +46,10 @@ defaults: &defaults
# restore_cache:
# key: v1-repo-{{ .Branch }}-{{ .Revision }}

default-context: &default-context
context:
- org-global

commands:
install_js:
parameters:
Expand Down Expand Up @@ -114,7 +118,7 @@ commands:

jobs:
checkout:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -125,7 +129,7 @@ jobs:
name: Check for duplicated packages
command: yarn deduplicate
test_unit:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -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
Expand All @@ -163,7 +167,7 @@ jobs:
name: Lint Markdown
command: yarn markdownlint
test_static:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand Down Expand Up @@ -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:
Expand All @@ -211,7 +215,7 @@ jobs:
path: /tmp/_karma_webpack_
destination: artifact-file
test_types:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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

0 comments on commit 398eec2

Please sign in to comment.