From 56f982cb0513cc341cc123239c1d28215d951624 Mon Sep 17 00:00:00 2001 From: Piotr Szpak Date: Mon, 5 Feb 2024 09:36:49 +0000 Subject: [PATCH] add coverage support --- .github/workflows/on-push-branch-turbo.yml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/on-push-branch-turbo.yml b/.github/workflows/on-push-branch-turbo.yml index 29207072b4a..9807e100936 100644 --- a/.github/workflows/on-push-branch-turbo.yml +++ b/.github/workflows/on-push-branch-turbo.yml @@ -47,3 +47,28 @@ jobs: uses: SimenB/github-actions-cpu-cores@v1 - name: Test ${{ matrix.package }} run: yarn turbo test --filter="${{ matrix.package }}" --cache-dir=.turbo --only --no-deps -- --coverage --maxWorkers=${{ steps.cpu-cores.outputs.count }} --ci + - name: move coverage + shell: bash + run: mv coverage/coverage-final.json coverage/${{matrix.package}}.json + - uses: actions/upload-artifact@v3 + with: + name: coverage-artifacts + path: coverage/ + report-coverage: + runs-on: ubuntu-latest + needs: [test-turbo] + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: coverage + - name: Merge Code Coverage + run: npx nyc merge coverage/ merged-output/merged-coverage.json + - uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + directory: merged-output + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}