openmct/.circleci/config.yml
John Hill bf7b672957
[CI] Disable html unit test reporting to increase CI Speed (#4416)
* [CI] Disable html unit test reporting to increase CI Speed

* remove package

* Remove istanbul html reports

* clean up errors

* Update README.md
2021-11-01 09:02:32 -07:00

104 lines
3.0 KiB
YAML

version: 2.1
executors:
linux:
docker:
- image: cimg/base:stable
orbs:
node: circleci/node@4.5.1
browser-tools: circleci/browser-tools@1.1.3
jobs:
test:
parameters:
node-version:
type: string
browser:
type: string
executor: linux
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
- when:
condition:
equal: [ "FirefoxESR", <<parameters.browser>> ]
steps:
- browser-tools/install-firefox:
version: "91.2.0esr" #https://archive.mozilla.org/pub/firefox/releases/
- when:
condition:
equal: [ "Firefox", <<parameters.browser>> ]
steps:
- browser-tools/install-firefox
- when:
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
- 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/
workflows:
matrix-tests:
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-only
node-version: lts/erbium
browser: "" #Skip testing
- test:
name: node14-build-only
node-version: lts/fermium
browser: "" #Skip testing
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:
name: node14-firefox-nightly
node-version: lts/fermium
browser: Firefox
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master