Skip to content

Commit 387a468

Browse files
author
benoit-cty
committed
coverage config
1 parent a40f504 commit 387a468

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/test-package.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
pull_request:
77
paths:
88
- "codecarbon/**"
9+
- "test/**"
10+
- "pyproject.toml"
11+
- "uv.lock"
12+
push:
13+
branches: [master]
14+
paths:
15+
- "codecarbon/**"
16+
- "test/**"
917
- "pyproject.toml"
1018
- "uv.lock"
1119

@@ -28,7 +36,7 @@ jobs:
2836
- name: Test package
2937
run: uv run --python ${{ matrix.python-version }} task test-coverage
3038
- name: Upload coverage to Codecov
31-
uses: codecov/codecov-action@v5
39+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
3240
with:
3341
token: ${{ secrets.CODECOV_TOKEN }}
3442

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ mypy-check = "mypy -m codecarbon --ignore-missing-imports --no-strict-optional -
186186
lint = "black --check --diff . && ruff check . && mypy ."
187187
format = "black . && ruff check --fix --exit-non-zero-on-fix ."
188188
test-package = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
189-
test-coverage = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --cov=codecarbon --cov-report=xml --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
189+
test-coverage = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --cov --cov-report=xml --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
190190
test-package-integ = "CODECARBON_ALLOW_MULTIPLE_RUNS=True python -m pytest -vv tests/"
191191
docs = "cd docs/edit && make docs"
192192
carbonboard = "python codecarbon/viz/carbonboard.py"
@@ -205,3 +205,11 @@ version_pattern = "MAJOR.MINOR.PATCH[_TAGNUM]"
205205

206206
[tool.pytest.ini_options]
207207
pythonpath = "."
208+
209+
[tool.coverage.run]
210+
source = [
211+
"codecarbon",
212+
]
213+
omit = [
214+
"codecarbon/viz/*",
215+
]

0 commit comments

Comments
 (0)