Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] CircleCI refactor for stability and to simplify troubleshooting #4566

Merged
merged 35 commits into from
Dec 14, 2021
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9aa2617
Run more in nightly, jump off of node10 where possible
unlikelyzero Dec 11, 2021
4d2b290
Updated config.yml
unlikelyzero Dec 11, 2021
0735871
Updated config.yml
unlikelyzero Dec 11, 2021
e00fdb0
Updated config.yml
unlikelyzero Dec 11, 2021
46c59eb
Updated config.yml
unlikelyzero Dec 11, 2021
721a94b
Updated config.yml
unlikelyzero Dec 11, 2021
192a707
Updated config.yml
unlikelyzero Dec 11, 2021
ec476aa
Updated config.yml
unlikelyzero Dec 11, 2021
6eaa368
Updated config.yml
unlikelyzero Dec 11, 2021
91dad7d
Updated config.yml
unlikelyzero Dec 11, 2021
ca2ccaa
Updated config.yml
unlikelyzero Dec 11, 2021
51673d6
Updated config.yml
unlikelyzero Dec 11, 2021
58c4a18
Updated config.yml
unlikelyzero Dec 11, 2021
de8034a
Updated config.yml
unlikelyzero Dec 11, 2021
1ac71e0
Updated config.yml
unlikelyzero Dec 11, 2021
e9329f4
Updated config.yml
unlikelyzero Dec 11, 2021
871b651
Updated config.yml
unlikelyzero Dec 11, 2021
9dc07e7
Updated config.yml
unlikelyzero Dec 11, 2021
d547bed
Updated config.yml
unlikelyzero Dec 11, 2021
409db61
Updated config.yml
unlikelyzero Dec 11, 2021
0b72477
Updated config.yml
unlikelyzero Dec 11, 2021
75c6a88
Updated config.yml
unlikelyzero Dec 11, 2021
cff76d8
Updated config.yml
unlikelyzero Dec 11, 2021
2ad7d38
Updated config.yml
unlikelyzero Dec 13, 2021
c4b584e
Updated config.yml
unlikelyzero Dec 13, 2021
227461b
Updated config.yml
unlikelyzero Dec 13, 2021
add8bde
Updated config.yml
unlikelyzero Dec 14, 2021
15ce961
Updated config.yml
unlikelyzero Dec 14, 2021
80f5c85
Updated config.yml
unlikelyzero Dec 14, 2021
1e42d2b
Updated config.yml
unlikelyzero Dec 14, 2021
d714253
Updated config.yml
unlikelyzero Dec 14, 2021
6916461
Updated config.yml
unlikelyzero Dec 14, 2021
288106c
Updated config.yml
unlikelyzero Dec 14, 2021
0d69372
Updated config.yml
unlikelyzero Dec 14, 2021
6b0604b
Updated config.yml
unlikelyzero Dec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 121 additions & 75 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,107 @@
version: 2.1
executors:
linux:
pw-focal-development:
docker:
- image: mcr.microsoft.com/playwright:focal
orbs:
node: circleci/node@4.5.1
browser-tools: circleci/browser-tools@1.1.3
jobs:
npm-audit:
executor: linux
environment:
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
parameters:
BUST_CACHE:
description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!"
default: false
type: boolean
commands:
build_and_install:
description: "All steps used to build and install. Will not work on node10"
parameters:
node-version:
type: string
steps:
- checkout
- restore_cache_cmd:
node-version: << parameters.node-version >>
- node/install:
install-npm: true
node-version: lts/fermium
- run: npm install
- run: npm audit --audit-level=low
test:
restore_cache_cmd:
description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache"
parameters:
node-version:
type: string
browser:
steps:
- when:
condition:
equal: [false, << pipeline.parameters.BUST_CACHE >> ]
steps:
- restore_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
save_cache_cmd:
description: "Custom command for saving cache."
parameters:
node-version:
type: string
executor: linux
steps:
- save_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/.npm
- node_modules
generate_and_store_version_and_filesystem_artifacts:
description: "Track important packages and files"
steps:
- run: |
mkdir /tmp/artifacts
printenv NODE_ENV >> /tmp/artifacts/NODE_ENV.txt
npm -v >> /tmp/artifacts/npm-version.txt
node -v >> /tmp/artifacts/node-version.txt
ls -latR >> /tmp/artifacts/dir.txt
- store_artifacts:
path: /tmp/artifacts/
upload_code_covio:
description: "Command to upload code coverage reports to codecov.io"
steps:
- run: curl -Os https://uploader.codecov.io/latest/linux/codecov;chmod +x codecov;./codecov
orbs:
node: circleci/node@4.9.0
browser-tools: circleci/browser-tools@1.2.3
jobs:
npm-audit:
parameters:
node-version:
type: string
executor: pw-focal-development
steps:
- build_and_install:
node-version: <<parameters.node-version>>
- run: npm audit --audit-level=low
- generate_and_store_version_and_filesystem_artifacts
node10-lint:
executor: pw-focal-development
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
- node/install:
install-npm: false
node-version: << parameters.node-version >>
install-npm: false #Cannot install latest npm version with node10.
node-version: lts/dubnium
- run: npm install
- run: npm run lint
- generate_and_store_version_and_filesystem_artifacts
unit-test:
parameters:
node-version:
type: string
browser:
type: string
executor: pw-focal-development
steps:
- build_and_install:
node-version: <<parameters.node-version>>
- when:
condition:
equal: [ "FirefoxESR", <<parameters.browser>> ]
steps:
- browser-tools/install-firefox:
version: "91.2.0esr" #https://archive.mozilla.org/pub/firefox/releases/
version: "91.4.0esr" #https://archive.mozilla.org/pub/firefox/releases/
- when:
condition:
equal: [ "FirefoxHeadless", <<parameters.browser>> ]
Expand All @@ -48,94 +113,75 @@ jobs:
steps:
- browser-tools/install-chrome:
replace-existing: false
- save_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
paths:
- ~/.npm
- ~/.cache
- node_modules
- when:
condition:
equal: [ "", <<parameters.browser>> ] #Only run linting when browsers are not running to save time
steps:
- run: npm run lint
- when:
condition: << parameters.browser >> #Truthy evaluation to only run when browser is specified
steps:
- run: npm run test:coverage -- --browsers=<<parameters.browser>>
- store_test_results:
path: dist/reports/tests/
- store_artifacts:
path: dist/reports/
e2e:
- run: npm run test:coverage -- --browsers=<<parameters.browser>>
- save_cache_cmd:
node-version: <<parameters.node-version>>
- store_test_results:
path: dist/reports/tests/
- store_artifacts:
path: dist/reports/
- generate_and_store_version_and_filesystem_artifacts
e2e-test:
parameters:
node-version:
type: string
suite:
type: string
executor: linux
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
executor: pw-focal-development
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
- node/install:
install-npm: false
node-version: << parameters.node-version >>
- run: npm install
- save_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
paths:
- ~/.npm
- ~/.cache
- node_modules
- build_and_install:
node-version: <<parameters.node-version>>
- run: npx playwright install
- run: npm run test:e2e:<<parameters.suite>>
- store_test_results:
path: test-results/results.xml
- store_artifacts:
path: test-results
- generate_and_store_version_and_filesystem_artifacts
workflows:
matrix-tests:
overall-circleci-commit-status: #These jobs run on every commit
jobs:
- test:
post-steps:
- run:
command:
curl -Os https://uploader.codecov.io/latest/linux/codecov;chmod +x codecov;./codecov
name: node10-chrome
node-version: lts/dubnium
browser: ChromeHeadless
- test:
name: node12-build-lint
- node10-lint
- unit-test:
name: node12-chrome
node-version: lts/erbium
browser: "" #Skip unit tests
- test:
name: node14-build-lint
browser: ChromeHeadless
- unit-test:
name: node14-chrome
node-version: lts/fermium
browser: "" #Skip unit tests
- e2e:
browser: ChromeHeadless
post-steps:
- upload_code_covio
- e2e-test:
name: e2e-smoke
node-version: lts/fermium
suite: ci
nightly:
the-nightly: #These jobs do not run on PRs, but against master at night
jobs:
- test:
- unit-test:
name: node10-chrome-nightly
node-version: lts/dubnium
browser: ChromeHeadless
- test:
- unit-test:
name: node12-firefoxESR-nightly
node-version: lts/erbium
browser: FirefoxESR
- test:
- unit-test:
name: node12-chrome-nightly
node-version: lts/erbium
browser: ChromeHeadless
- unit-test:
name: node14-firefox-nightly
node-version: lts/fermium
browser: FirefoxHeadless
- npm-audit
- e2e:
name: e2e-full
- unit-test:
name: node14-chrome-nightly
node-version: lts/fermium
browser: ChromeHeadless
- npm-audit:
node-version: lts/fermium
- e2e-test:
name: e2e-full-nightly
node-version: lts/fermium
suite: full
triggers:
Expand Down