From 59018ecc26af15c79b297845c3f94340a5b93f16 Mon Sep 17 00:00:00 2001 From: SnorfYang <68773271+snorfyang@users.noreply.github.com> Date: Sun, 7 May 2023 18:04:25 +0800 Subject: [PATCH] ci: add tests coverage --- .github/codecov.yml | 17 +++++++++++++++++ .github/workflows/tests-coverage.yml | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/codecov.yml create mode 100644 .github/workflows/tests-coverage.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..51013e66e --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,17 @@ +github_checks: + annotations: true + +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: 65...100 + + status: + # Learn more at https://docs.codecov.io/docs/commit-status + project: + default: + target: 65% + threshold: 0.05 # allow this much decrease on project diff --git a/.github/workflows/tests-coverage.yml b/.github/workflows/tests-coverage.yml new file mode 100644 index 000000000..97071cbe1 --- /dev/null +++ b/.github/workflows/tests-coverage.yml @@ -0,0 +1,21 @@ +name: Tests coverage + +on: pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js 14.x + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Install and test + run: | + yarn --frozen-lockfile + yarn test:app --coverage + - name: Test Coverage + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true