2021-07-14 16:26:38 +00:00
|
|
|
version: 2.1
|
|
|
|
executors:
|
|
|
|
linux:
|
2018-07-20 23:00:13 +00:00
|
|
|
docker:
|
2021-11-30 00:34:47 +00:00
|
|
|
- image: mcr.microsoft.com/playwright:focal
|
2021-07-14 16:26:38 +00:00
|
|
|
orbs:
|
|
|
|
node: circleci/node@4.5.1
|
|
|
|
browser-tools: circleci/browser-tools@1.1.3
|
|
|
|
jobs:
|
2021-11-04 13:53:55 +00:00
|
|
|
npm-audit:
|
|
|
|
executor: linux
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- node/install:
|
|
|
|
install-npm: true
|
|
|
|
node-version: lts/fermium
|
|
|
|
- run: npm install
|
|
|
|
- run: npm audit --audit-level=low
|
2021-07-14 16:26:38 +00:00
|
|
|
test:
|
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
|
|
|
browser:
|
|
|
|
type: string
|
|
|
|
executor: linux
|
2018-07-20 23:00:13 +00:00
|
|
|
steps:
|
2021-07-14 16:26:38 +00:00
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
|
|
|
|
- node/install:
|
2021-11-01 16:02:32 +00:00
|
|
|
install-npm: false
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: << parameters.node-version >>
|
2021-11-01 16:02:32 +00:00
|
|
|
- run: npm install
|
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-10-29 16:52:47 +00:00
|
|
|
version: "91.2.0esr" #https://archive.mozilla.org/pub/firefox/releases/
|
|
|
|
- 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
|
|
|
|
- save_cache:
|
|
|
|
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}
|
|
|
|
paths:
|
|
|
|
- ~/.npm
|
|
|
|
- ~/.cache
|
|
|
|
- node_modules
|
2021-11-30 00:34:47 +00:00
|
|
|
- ~/Library/Caches/ms-playwright
|
2021-10-29 16:52:47 +00:00
|
|
|
- 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/
|
2021-11-30 00:34:47 +00:00
|
|
|
e2e:
|
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
|
|
|
suite:
|
|
|
|
type: string
|
|
|
|
executor: linux
|
|
|
|
environment:
|
|
|
|
NODE_ENV: development # Needed if playwright is in `devDependencies`
|
|
|
|
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
|
|
|
|
- ~/Library/Caches/ms-playwright
|
|
|
|
- run: npm run test:e2e:<<parameters.suite>>
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results/results.xml
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
2018-07-20 23:00:13 +00:00
|
|
|
workflows:
|
2021-07-14 16:26:38 +00:00
|
|
|
matrix-tests:
|
2018-07-20 23:00:13 +00:00
|
|
|
jobs:
|
2021-07-14 16:26:38 +00:00
|
|
|
- test:
|
2021-10-29 16:52:47 +00:00
|
|
|
post-steps:
|
|
|
|
- run:
|
|
|
|
command:
|
|
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov;chmod +x codecov;./codecov
|
2021-07-14 16:26:38 +00:00
|
|
|
name: node10-chrome
|
|
|
|
node-version: lts/dubnium
|
|
|
|
browser: ChromeHeadless
|
|
|
|
- test:
|
2021-11-01 20:21:08 +00:00
|
|
|
name: node12-build-lint
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: lts/erbium
|
2021-11-01 20:21:08 +00:00
|
|
|
browser: "" #Skip unit tests
|
2021-10-29 16:52:47 +00:00
|
|
|
- test:
|
2021-11-01 20:21:08 +00:00
|
|
|
name: node14-build-lint
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: lts/fermium
|
2021-11-01 20:21:08 +00:00
|
|
|
browser: "" #Skip unit tests
|
2021-11-30 00:34:47 +00:00
|
|
|
- e2e:
|
|
|
|
name: e2e-smoke
|
|
|
|
node-version: lts/fermium
|
|
|
|
suite: ci
|
2021-08-18 20:16:15 +00:00
|
|
|
nightly:
|
|
|
|
jobs:
|
|
|
|
- test:
|
|
|
|
name: node10-chrome-nightly
|
|
|
|
node-version: lts/dubnium
|
|
|
|
browser: ChromeHeadless
|
|
|
|
- test:
|
|
|
|
name: node12-firefoxESR-nightly
|
|
|
|
node-version: lts/erbium
|
|
|
|
browser: FirefoxESR
|
|
|
|
- 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-11-04 13:53:55 +00:00
|
|
|
- npm-audit
|
2021-11-30 00:34:47 +00:00
|
|
|
- e2e:
|
|
|
|
name: e2e-full
|
|
|
|
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
|