From 991a6e6014df3efdb498ff49ccc9cc84e4e81473 Mon Sep 17 00:00:00 2001 From: zwzhang Date: Wed, 6 Dec 2023 16:11:02 +0800 Subject: [PATCH] chores: add code cov (#39) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 佑祎 --- .github/workflows/ci.yaml | 7 +++++++ codecov.yaml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 codecov.yaml 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