forked from applied-material-modeling/neml2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodecov.yaml
More file actions
67 lines (63 loc) · 2.72 KB
/
Copy pathcodecov.yaml
File metadata and controls
67 lines (63 loc) · 2.72 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
# Codecov configuration. See https://docs.codecov.com/docs/codecov-yaml
#
# Uploads pass ``CODECOV_TOKEN`` (a repository secret) because Codecov
# rejects tokenless OIDC uploads on protected branches. See the
# ``coverage`` job in .github/workflows/python.yaml.
coverage:
status:
# Both the Python (``unittests``) and C++ (``cpp``) statuses are hard gates
# (``informational: false``): when the target isn't met Codecov posts a
# FAILING ``codecov/project`` / ``codecov/patch`` check on the PR. The C++
# surface is gated as strictly as the Python one -- the cpp-coverage CI job
# runs on both ubuntu (cpu) and the gpu_runner (GPU paths), and Codecov merges
# the two so the GPU-gated branches are covered too. To actually block
# merging, add the checks to the branch protection rule for ``main`` (Settings
# -> Branches -> Require status checks) -- that part lives in the GitHub repo
# settings, not this file.
project:
default:
flags: [unittests] # Python only -- C++ is gated separately
target: auto # overall coverage can't drop vs the base
threshold: 0.5% # allow 0.5% wiggle for rounding
informational: false # fail the PR status if overall coverage drops
cpp:
flags: [cpp]
target: auto # C++ coverage can't drop vs the base
threshold: 0.5%
informational: false
patch:
default:
flags: [unittests] # Python only -- C++ is gated separately
target: 90% # new code in a PR must hit 90% coverage
threshold: 1% # 1% tolerance below target (passes at >= 89%)
informational: false # fail the PR status if patch coverage misses
cpp:
flags: [cpp]
target: 90% # new C++ in a PR must hit 90% coverage
threshold: 1%
informational: false
# Coverage flags. ``unittests`` is the Python suite (pytest --cov); ``cpp`` is
# the clang source-based C++ coverage of the runtime (scripts/cpp_coverage.sh).
flags:
unittests:
carryforward: false
cpp:
paths:
- neml2/csrc/
carryforward: true # reuse the last C++ run when a PR is Python-only
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # comment on every PR, not only when coverage moves
require_base: false
require_head: true
# Mirror what ``[tool.coverage.run] source = ["neml2"]`` in pyproject.toml
# already enforces -- defense in depth so a misconfigured collection run
# doesn't accidentally count non-product code.
ignore:
- "tests/**"
- "doc/**"
- "benchmark/**"
- "scripts/**"
- "contrib/**"
- "neml2/aoti/_aoti.pyi"