Add codecov.io and make general CircleCI Improvements (#4375)

This commit is contained in:
John Hill 2021-10-29 09:52:47 -07:00 committed by GitHub
parent c4a87ae5d7
commit 1e11bbc2ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 24 deletions

View File

@ -13,8 +13,6 @@ jobs:
type: string
browser:
type: string
always-pass:
type: boolean
executor: linux
steps:
- checkout
@ -24,13 +22,18 @@ jobs:
node-version: << parameters.node-version >>
- node/install-packages:
override-ci-command: npm install
- when: # Just to save time until caching saves the browser bin
- when:
condition:
equal: [ "FirefoxESR", <<parameters.browser>> ]
steps:
- browser-tools/install-firefox:
version: "78.11.0esr" #https://archive.mozilla.org/pub/firefox/releases/
- when: # Just to save time until caching saves the browser bin
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:
@ -42,47 +45,53 @@ jobs:
- ~/.npm
- ~/.cache
- node_modules
- run: npm run lint
- run: npm run test:coverage -- --browsers=<<parameters.browser>> || <<parameters.always-pass>>
- store_test_results:
path: dist/reports/tests/
- store_artifacts:
path: dist/reports/
- 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
always-pass: false
- test:
name: node12-firefoxESR-build-only
name: node12-build-only
node-version: lts/erbium
browser: FirefoxESR
always-pass: true
- test:
name: node14-chrome-build-only
browser: "" #Skip testing
- test:
name: node14-build-only
node-version: lts/fermium
browser: ChromeHeadless
always-pass: true
browser: "" #Skip testing
nightly:
jobs:
- test:
name: node10-chrome-nightly
node-version: lts/dubnium
browser: ChromeHeadless
always-pass: false
- test:
name: node12-firefoxESR-nightly
node-version: lts/erbium
browser: FirefoxESR
always-pass: false
- test:
name: node14-chrome-nightly
name: node14-firefox-nightly
node-version: lts/fermium
browser: ChromeHeadless
always-pass: false
browser: Firefox
triggers:
- schedule:
cron: "0 0 * * *"

3
.gitignore vendored
View File

@ -44,3 +44,6 @@ report.*.json
.lighthouseci
package-lock.json
#codecov artifacts
codecov

20
codecov.yml Normal file
View File

@ -0,0 +1,20 @@
codecov:
require_ci_to_pass: false
coverage:
precision: 2
round: down
range: "70...100"
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: false