From 735411f3329ed0ff2c40b5aa9004dd0269e41e67 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 11 Sep 2020 11:18:52 +0200 Subject: [PATCH] Upload test coverage to codecov (#2406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .github/workflows/ci.yml | 6 ++++-- .github/workflows/master.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a094a10b3..c8c92c57ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 469ef20cda..f99c266241 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -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