diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96afd9b9..6482d033 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,3 +67,10 @@ jobs: - name: ${{ matrix.name }} run: | ${{ matrix.command }} + - if: matrix.step == 'test' + name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + flags: unittests + file: cover.out + fail_ci_if_error: true diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..e07c8a72 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,36 @@ +# https://docs.codecov.com/docs/commit-status +coverage: + status: + project: + # global coverage + default: + target: auto + threshold: 2% + flags: + - unittests + paths: + - "pkg" + if_ci_failed: error + if_no_uploads: error + if_not_found: success + patch: + # diff coverage + default: + target: 70% + flags: + - unittests + paths: + - "pkg" + informational: true + if_ci_failed: ignore + if_no_uploads: success + if_not_found: success + +ignore: + - "apis" + - "yarn/client" + - "yarn/apis" + - "**/*_generated.*" + +github_checks: + annotations: true