ci: add tests coverage

This commit is contained in:
SnorfYang 2023-05-07 18:04:25 +08:00
parent 026949204d
commit 59018ecc26
2 changed files with 38 additions and 0 deletions

17
.github/codecov.yml vendored Normal file
View file

@ -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

21
.github/workflows/tests-coverage.yml vendored Normal file
View file

@ -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