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-12-27 22:46:19 +00:00
|
|
|
- image: mcr.microsoft.com/playwright:v1.29.0-focal
|
2021-12-14 21:43:44 +00:00
|
|
|
environment:
|
|
|
|
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
2022-07-30 00:35:43 +00:00
|
|
|
PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps
|
2022-09-09 20:29:03 +00:00
|
|
|
PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742)
|
2021-12-14 21:43:44 +00:00
|
|
|
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:
|
2022-06-30 18:50:47 +00:00
|
|
|
description: "All steps used to build and install. Will use cache if found"
|
2021-12-14 21:43:44 +00:00
|
|
|
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 >>
|
2022-05-25 22:45:11 +00:00
|
|
|
- run: npm install --prefer-offline --no-audit --progress=false
|
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:
|
2022-06-03 16:46:27 +00:00
|
|
|
condition:
|
2021-12-14 21:43:44 +00:00
|
|
|
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
|
2022-06-03 16:46:27 +00:00
|
|
|
steps:
|
2021-12-14 21:43:44 +00:00
|
|
|
- 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/
|
2022-06-30 18:50:47 +00:00
|
|
|
generate_e2e_code_cov_report:
|
|
|
|
description: "Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test"
|
|
|
|
parameters:
|
|
|
|
suite:
|
|
|
|
type: string
|
|
|
|
steps:
|
2022-07-30 00:35:43 +00:00
|
|
|
- run: npm run cov:e2e:report || true
|
|
|
|
- run: npm run cov:e2e:<<parameters.suite>>:publish
|
2021-12-14 21:43:44 +00:00
|
|
|
orbs:
|
|
|
|
node: circleci/node@4.9.0
|
2022-05-03 00:34:07 +00:00
|
|
|
browser-tools: circleci/browser-tools@1.3.0
|
2021-12-14 21:43:44 +00:00
|
|
|
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-02-15 22:08:53 +00:00
|
|
|
lint:
|
2022-01-07 19:39:25 +00:00
|
|
|
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
|
|
|
|
executor: pw-focal-development
|
|
|
|
steps:
|
|
|
|
- build_and_install:
|
|
|
|
node-version: <<parameters.node-version>>
|
2022-07-27 21:31:18 +00:00
|
|
|
- browser-tools/install-chrome:
|
|
|
|
replace-existing: false
|
|
|
|
- run: npm run test
|
2022-06-30 18:50:47 +00:00
|
|
|
- run: npm run cov:unit:publish
|
2021-12-14 21:43:44 +00:00
|
|
|
- save_cache_cmd:
|
|
|
|
node-version: <<parameters.node-version>>
|
|
|
|
- store_test_results:
|
|
|
|
path: dist/reports/tests/
|
|
|
|
- store_artifacts:
|
2022-06-30 18:50:47 +00:00
|
|
|
path: coverage
|
2021-12-14 21:43:44 +00:00
|
|
|
- generate_and_store_version_and_filesystem_artifacts
|
|
|
|
e2e-test:
|
2021-11-30 00:34:47 +00:00
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
2022-07-27 21:31:18 +00:00
|
|
|
suite: #stable or full
|
2021-11-30 00:34:47 +00:00
|
|
|
type: string
|
2021-12-14 21:43:44 +00:00
|
|
|
executor: pw-focal-development
|
2022-05-25 22:45:11 +00:00
|
|
|
parallelism: 4
|
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>>
|
2022-07-27 21:31:18 +00:00
|
|
|
- when: #Only install chrome-beta when running the 'full' suite to save $$$
|
2022-06-30 18:50:47 +00:00
|
|
|
condition:
|
|
|
|
equal: [ "full", <<parameters.suite>> ]
|
|
|
|
steps:
|
|
|
|
- run: npx playwright install chrome-beta
|
2022-05-25 22:45:11 +00:00
|
|
|
- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<<parameters.suite>> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
|
2022-06-30 18:50:47 +00:00
|
|
|
- generate_e2e_code_cov_report:
|
|
|
|
suite: <<parameters.suite>>
|
2021-11-30 00:34:47 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results/results.xml
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
2022-06-30 18:50:47 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
|
|
|
- store_artifacts:
|
|
|
|
path: html-test-results
|
2021-12-14 21:43:44 +00:00
|
|
|
- generate_and_store_version_and_filesystem_artifacts
|
2022-05-25 22:45:11 +00:00
|
|
|
perf-test:
|
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
|
|
|
executor: pw-focal-development
|
|
|
|
steps:
|
|
|
|
- build_and_install:
|
|
|
|
node-version: <<parameters.node-version>>
|
|
|
|
- run: npm run test:perf
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results/results.xml
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
2022-06-30 18:50:47 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: html-test-results
|
|
|
|
- generate_and_store_version_and_filesystem_artifacts
|
2022-07-30 00:35:43 +00:00
|
|
|
visual-test:
|
|
|
|
parameters:
|
|
|
|
node-version:
|
|
|
|
type: string
|
|
|
|
executor: pw-focal-development
|
|
|
|
steps:
|
|
|
|
- build_and_install:
|
|
|
|
node-version: <<parameters.node-version>>
|
|
|
|
- run: npm run test:e2e:visual
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results/results.xml
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
|
|
|
- store_artifacts:
|
|
|
|
path: html-test-results
|
|
|
|
- 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-02-15 22:08:53 +00:00
|
|
|
- lint:
|
2022-06-30 18:50:47 +00:00
|
|
|
name: node14-lint
|
2021-07-14 16:26:38 +00:00
|
|
|
node-version: lts/fermium
|
2022-04-19 22:05:08 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node18-chrome
|
|
|
|
node-version: "18"
|
2021-12-14 21:43:44 +00:00
|
|
|
- e2e-test:
|
2022-07-27 21:31:18 +00:00
|
|
|
name: e2e-stable
|
2022-02-15 22:08:53 +00:00
|
|
|
node-version: lts/gallium
|
2022-07-27 21:31:18 +00:00
|
|
|
suite: stable
|
2022-05-25 22:45:11 +00:00
|
|
|
- perf-test:
|
|
|
|
node-version: lts/gallium
|
2022-07-30 00:35:43 +00:00
|
|
|
- visual-test:
|
|
|
|
node-version: lts/gallium
|
|
|
|
|
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:
|
|
|
|
name: node14-chrome-nightly
|
|
|
|
node-version: lts/fermium
|
2022-02-15 22:08:53 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node16-chrome-nightly
|
|
|
|
node-version: lts/gallium
|
2022-04-19 22:05:08 +00:00
|
|
|
- unit-test:
|
|
|
|
name: node18-chrome
|
|
|
|
node-version: "18"
|
2021-12-14 21:43:44 +00:00
|
|
|
- npm-audit:
|
2022-02-15 22:08:53 +00:00
|
|
|
node-version: lts/gallium
|
2021-12-14 21:43:44 +00:00
|
|
|
- e2e-test:
|
|
|
|
name: e2e-full-nightly
|
2022-02-15 22:08:53 +00:00
|
|
|
node-version: lts/gallium
|
2021-11-30 00:34:47 +00:00
|
|
|
suite: full
|
2022-07-30 00:35:43 +00:00
|
|
|
- perf-test:
|
|
|
|
node-version: lts/gallium
|
|
|
|
- visual-test:
|
|
|
|
node-version: lts/gallium
|
2021-08-18 20:16:15 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
2022-07-15 15:58:03 +00:00
|
|
|
cron: "0 0 * * *"
|
2021-08-18 20:16:15 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-11-30 00:34:47 +00:00
|
|
|
- master
|