我有一个私有的 Github 存储库,我想与 Codecov 集成并检查每个打开的 PR 的覆盖率。就生成覆盖率报告并将该报告上传到 Codecov 而言,一切都很好,但是如果项目的测试覆盖率未达到某个百分比,我将无法让 Github 检查失败。
作为参考,我codecode.yml
的回购配置是:
codecov:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: '90...100'
status:
project:
default: # This can be anything, but it needs to exist as the name
# basic settings
target: 90%
threshold: 0%
if_ci_failed: error #success, failure, error, ignore
only_pulls: false
patch:
default:
target: auto
threshold: 0%
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: 'reach,diff,flags,files,footer'
behavior: default
require_changes: no