Upload test coverage to codecov (#2406)

* Add CI task to upload test coverage to codecov

Backstage CLI runs tests in coverage mode. Jest generates coverage reports in individual
coverage/ directories of packages.
We don't need a Codecov token here because our repository is public

* Upload test coverage on master build

* tests and coverage upload have to be run in same CI task

* try coverage report with yarn test:all

* Use yarn test and test:all commands

* Use lower level commands on CI

* CLI working 

* Do not upload partial coverage reports
This commit is contained in:
Himanshu Mishra
2020-09-11 11:18:52 +02:00
committed by GitHub
parent 2398a95e5c
commit 735411f332
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -93,9 +93,11 @@ jobs:
if: ${{ steps.yarn-lock.outcome == 'success' }}
run: yarn lerna -- run test --since origin/master -- --coverage
- name: test all packages
- name: test all packages (and upload coverage)
if: ${{ steps.yarn-lock.outcome == 'failure' }}
run: yarn lerna -- run test -- --coverage
run: |
yarn lerna -- run test -- --coverage
bash <(curl -s https://codecov.io/bash)
- name: verify plugin template
run: yarn lerna -- run diff -- --check
+4 -2
View File
@@ -59,8 +59,10 @@ jobs:
- name: verify type dependencies
run: yarn lint:type-deps
- name: test
run: yarn lerna -- run test -- --coverage
- name: test (and upload coverage)
run: |
yarn lerna -- run test -- --coverage
bash <(curl -s https://codecov.io/bash)
# Publishes current version of packages that are not already present in the registry
- name: publish