Repository navigation
Expand file tree
/
Copy pathcodecov.yml
More file actions
86 lines (78 loc) · 3.2 KB
/
Copy pathcodecov.yml
File metadata and controls
86 lines (78 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Codecov configuration for COMEBACKHERE-contracts
#
# Validates against: https://api.codecov.io/validate
#
# Project-level threshold: 95% minimum line coverage, matching the targets
# established in issues #91 (compliance), #92 (treasury), and #93 (invoice).
# A PR whose merged coverage falls below 95% will receive a failing Codecov
# status check, preventing silent erosion of hard-won coverage.
#
# Per-contract flags allow Codecov to report and enforce coverage independently
# for each contract. The workflow uploads each contract's report under its own
# flag name (invoice, treasury, compliance) so regressions in a single contract
# are immediately visible rather than masked by aggregate numbers.
codecov:
# Only read this YAML from the main branch so feature branches cannot
# accidentally weaken the threshold gate.
strict_yaml_branch: main
coverage:
precision: 2
round: down
# Green range: 95 – 100%. Anything below 95 renders as red.
range: "95...100"
status:
# ── Project-wide gate ──────────────────────────────────────────────────
# Fails the Codecov status check if total project coverage drops below 95%.
# `threshold: 0%` means any drop from the base commit is flagged; there is
# no grace margin beyond the absolute 95% floor set by `target`.
project:
default:
target: 95%
threshold: 0%
base: auto
invoice:
target: 95%
threshold: 0%
flags:
- invoice
treasury:
target: 95%
threshold: 0%
flags:
- treasury
compliance:
target: 95%
threshold: 0%
flags:
- compliance
# ── Patch gate ────────────────────────────────────────────────────────
# New lines introduced in a PR must themselves be ≥ 95% covered.
# This stops the pattern of adding untested code while the aggregate stays
# above the floor because existing tests carry the overall percentage.
patch:
default:
target: 95%
threshold: 0%
# ── Per-contract flags ────────────────────────────────────────────────────────
# Each flag corresponds to one Codecov upload from the coverage workflow.
# carryforward: true means Codecov reuses the previous commit's report for a
# flag when a given PR run doesn't upload a fresh one (e.g. draft PRs), so the
# aggregate never artificially drops to zero.
flags:
invoice:
paths:
- contracts/invoice/src/
carryforward: true
treasury:
paths:
- contracts/treasury/src/
carryforward: true
compliance:
paths:
- contracts/compliance/src/
carryforward: true
# ── PR comment layout ─────────────────────────────────────────────────────────
comment:
layout: "reach,diff,flags,files"
behavior: default
require_changes: false