Skip to content

Commit 39ff173

Browse files
wmaynerclaude
andcommitted
Add Codecov coverage reporting to CI
- Add pytest-cov to dev dependencies - Configure coverage source in pyproject.toml - Run tests with coverage on ubuntu-latest/Python 3.12 - Upload coverage.xml to Codecov Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5b496c0 commit 39ff173

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ jobs:
3232
run: uv sync --python ${{ matrix.python-version }} --group dev --all-extras
3333

3434
- name: Run tests
35+
if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12') }}
3536
run: uv run pytest test/ --tb=short -v --ignore=test/test_parallel.py --ignore=test/test_parallel2.py
3637
continue-on-error: ${{ matrix.os == 'windows-latest' }}
3738

38-
- name: Upload coverage
39+
- name: Run tests with coverage
40+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
41+
run: uv run pytest test/ --tb=short -v --ignore=test/test_parallel.py --ignore=test/test_parallel2.py --cov=pyphi --cov-report=xml
42+
43+
- name: Upload coverage to Codecov
3944
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
4045
uses: codecov/codecov-action@v5
4146
with:
47+
files: ./coverage.xml
4248
fail_ci_if_error: false

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dev = [
6161
"coverage",
6262
"hypothesis",
6363
"pre-commit",
64+
"pytest-cov",
6465
"pyright>=1.1.407",
6566
"pytest<8.0.0",
6667
"pytest-lazy-fixture",
@@ -234,6 +235,7 @@ filterwarnings = [
234235

235236
[tool.coverage.run]
236237
branch = true
238+
source = ["pyphi"]
237239

238240
[tool.coverage.report]
239241
exclude_lines = [

uv.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)