2021-07-14 16:26:38 +00:00
|
|
|
version: 2.1
|
|
|
|
executors:
|
2021-12-14 21:43:44 +00:00
|
|
|
pw-focal-development:
|
2018-07-20 23:00:13 +00:00
|
|
|
docker:
|
2022-01-11 15:27:29 +00:00
|
|
|
- image: mcr.microsoft.com/playwright:v1.17.2-focal
|
2021-12-14 21:43:44 +00:00
|
|
|
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
|
2021-11-04 13:53:55 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2021-12-14 21:43:44 +00:00
|
|
|
- restore_cache_cmd:
|
|
|
|
node-version: << parameters.node-version >>
|
2021-11-04 13:53:55 +00:00
|
|
|
- node/install:
|
|
|
|
install-npm: true
|
2022-01-03 21:44:57 +00:00
|
|
|
node-version: << parameters.node-version >>
|
2021-11-04 13:53:55 +00:00
|
|
|
- run: npm install
|
2021-12-14 21:43:44 +00:00
|
|
|
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"
|
2021-07-14 16:26:38 +00:00
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
2021-12-14 21:43:44 +00:00
|
|
|
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:
|
2021-07-14 16:26:38 +00:00
|
|
|
type: string
|
2021-12-14 21:43:44 +00:00
|
|
|
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
|
2022-01-07 19:39:25 +00:00
|
|
|
node14-lint:
|
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
2021-12-14 21:43:44 +00:00
|
|
|
executor: pw-focal-development
|
2018-07-20 23:00:13 +00:00
|
|
|
steps:
|
2022-01-07 19:39:25 +00:00
|
|
|
- build_and_install:
|
|
|
|
node-version: <<parameters.node-version>>
|
2021-12-14 21:43:44 +00:00
|
|
|
- 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>>
|
2021-10-29 16:52:47 +00:00
|
|
|
- when:
|
2021-07-14 16:26:38 +00:00
|
|
|
condition:
|
|
|
|
equal: [ "FirefoxESR", <<parameters.browser>> ]
|
|
|
|
steps:
|
|
|
|
- browser-tools/install-firefox:
|
2021-12-14 21:43:44 +00:00
|
|
|
version: "91.4.0esr" #https://archive.mozilla.org/pub/firefox/releases/
|
2021-10-29 16:52:47 +00:00
|
|
|
- when:
|
|
|
|
condition:
|
2021-11-01 20:21:08 +00:00
|
|
|
equal: [ "FirefoxHeadless", <<parameters.browser>> ]
|
2021-10-29 16:52:47 +00:00
|
|
|
steps:
|
|
|
|
- browser-tools/install-firefox
|
|
|
|
- when:
|
2021-07-14 16:26:38 +00:00
|
|
|
condition:
|
|
|
|
equal: [ "ChromeHeadless", <<parameters.browser>> ]
|
|
|
|
steps:
|
|
|
|
- browser-tools/install-chrome:
|
|
|
|
replace-existing: false
|
2021-12-14 21:43:44 +00:00
|
|
|
- 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:
|
2021-11-30 00:34:47 +00:00
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
|
|
|
suite:
|
|
|
|
type: string
|
2021-12-14 21:43:44 +00:00
|
|
|
executor: pw-focal-development
|
2021-11-30 00:34:47 +00:00
|
|
|
steps:
|
2021-12-14 21:43:44 +00:00
|
|
|
- build_and_install:
|
|
|
|
node-version: <<parameters.node-version>>
|
2021-11-30 17:10:55 +00:00
|
|
|
- run: npx playwright install
|
2021-11-30 00:34:47 +00:00
|
|
|
- run: npm run test:e2e:<<parameters.suite>>
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results/results.xml
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
2021-12-14 21:43:44 +00:00
|
|
|
- generate_and_store_version_and_filesystem_artifacts
|
2018-07-20 23:00:13 +00:00
|
|
|
workflows:
|
2021-12-14 21:43:44 +00:00
|
|
|
overall-circleci-commit-status: #These jobs run on every commit
|
2018-07-20 23:00:13 +00:00
|
|
|
jobs:
|
2022-01-07 19:39:25 +00:00
|
|
|
- node14-lint:
|
|
|
|
node-version: lts/fermium
|
2021-12-14 21:43:44 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node12-chrome
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: lts/erbium
|
2021-12-14 21:43:44 +00:00
|
|
|
browser: ChromeHeadless
|
|
|
|
- unit-test:
|
|
|
|
name: node14-chrome
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: lts/fermium
|
2021-12-14 21:43:44 +00:00
|
|
|
browser: ChromeHeadless
|
|
|
|
post-steps:
|
|
|
|
- upload_code_covio
|
|
|
|
- e2e-test:
|
2022-01-05 17:57:25 +00:00
|
|
|
name: e2e-ci
|
2021-11-30 00:34:47 +00:00
|
|
|
node-version: lts/fermium
|
|
|
|
suite: ci
|
2021-12-14 21:43:44 +00:00
|
|
|
the-nightly: #These jobs do not run on PRs, but against master at night
|
2021-08-18 20:16:15 +00:00
|
|
|
jobs:
|
2021-12-14 21:43:44 +00:00
|
|
|
- unit-test:
|
2021-08-18 20:16:15 +00:00
|
|
|
name: node12-firefoxESR-nightly
|
|
|
|
node-version: lts/erbium
|
|
|
|
browser: FirefoxESR
|
2021-12-14 21:43:44 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node12-chrome-nightly
|
|
|
|
node-version: lts/erbium
|
|
|
|
browser: ChromeHeadless
|
|
|
|
- unit-test:
|
2021-10-29 16:52:47 +00:00
|
|
|
name: node14-firefox-nightly
|
2021-08-18 20:16:15 +00:00
|
|
|
node-version: lts/fermium
|
2021-11-01 20:21:08 +00:00
|
|
|
browser: FirefoxHeadless
|
2021-12-14 21:43:44 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node14-chrome-nightly
|
|
|
|
node-version: lts/fermium
|
|
|
|
browser: ChromeHeadless
|
|
|
|
- npm-audit:
|
|
|
|
node-version: lts/fermium
|
|
|
|
- e2e-test:
|
|
|
|
name: e2e-full-nightly
|
2021-11-30 00:34:47 +00:00
|
|
|
node-version: lts/fermium
|
|
|
|
suite: full
|
2021-08-18 20:16:15 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 0 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-11-30 00:34:47 +00:00
|
|
|
- master
|