Skip to content

Commit e9f59c6

Browse files
authored
chore: add codecov (#1590)
* Added codecov * Ignore tests * Only run pytest with coverage in one job * Use self-hosted CI * Run all tests * Use dev group * Also upload test results
1 parent 7f945d2 commit e9f59c6

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.github/workflows/build-test.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,35 @@ jobs:
238238
cupy
239239
kvikio
240240
nvcomp
241+
pytest-cov
242+
${{ matrix.cuda-version == 13 && 'root' || '' }}
241243
242244
- name: Pip install the package
243-
run: pip install --group=test .
245+
run: pip install --group=dev .
244246

245-
- name: Run pytest
247+
- name: Run only GPU tests
248+
if: matrix.cuda-version != 13
246249
run: |
247250
python -m pytest -vv tests-cuda --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
248251
252+
- name: Run full test suite and collect coverage
253+
if: matrix.cuda-version == 13
254+
run: |
255+
python -m pytest -vv tests tests-cuda --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"\
256+
--cov=uproot --cov-branch --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
257+
258+
- name: Upload coverage reports to Codecov
259+
if: matrix.cuda-version == 13
260+
uses: codecov/codecov-action@v5
261+
with:
262+
token: ${{ secrets.CODECOV_TOKEN }}
263+
264+
- name: Upload test results to Codecov
265+
if: ${{ !cancelled() }}
266+
uses: codecov/test-results-action@v1
267+
with:
268+
token: ${{ secrets.CODECOV_TOKEN }}
269+
249270
pass:
250271
if: always()
251272
needs: [build, vanilla-build, numpy1-build, pyodide-build]

codecov.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
comment:
5+
layout: files
6+
7+
coverage:
8+
status:
9+
project:
10+
default:
11+
# 'auto' sets the target to our current coverage %
12+
# 'threshold' allows a tiny 0.5% drop to prevent "flaky" failures
13+
target: auto
14+
threshold: 0.5%
15+
patch:
16+
default:
17+
# Ensures 98% of NEW code added in the PR is covered
18+
target: 98%
19+
threshold: 0%
20+
21+
github_checks:
22+
annotations: false

0 commit comments

Comments
 (0)