Skip to content

Commit d148a88

Browse files
committed
coverage: add coverage to CI
1 parent 4fa5a91 commit d148a88

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/shared.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ jobs:
5555
- name: Install the project
5656
run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}
5757

58-
- name: Run pytest
59-
run: uv run ${{ matrix.dep-resolution.install-flags }} --no-sync pytest
58+
- name: Run pytest with coverage
59+
run: |
60+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage run -m pytest
61+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage combine
62+
uv run ${{ matrix.dep-resolution.install-flags }} --no-sync coverage report
6063
env:
6164
UV_RESOLUTION: ${{ matrix.dep-resolution.name == 'lowest-direct' && 'lowest-direct' || 'highest' }}
6265

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ branch = true
176176
patch = ["subprocess"]
177177
concurrency = ["multiprocessing", "thread"]
178178
source = ["src", "tests"]
179+
relative_files = true
179180

180181
# https://coverage.readthedocs.io/en/latest/config.html#report
181182
[tool.coverage.report]
@@ -193,3 +194,11 @@ exclude_lines = [
193194
exclude_also = [
194195
'\A(?s:.*# pragma: exclude file.*)\Z'
195196
]
197+
198+
# https://coverage.readthedocs.io/en/latest/config.html#paths
199+
[tool.coverage.paths]
200+
source = [
201+
"src/",
202+
"/home/runner/work/python-sdk/python-sdk/src/",
203+
'D:\a\python-sdk\python-sdk\src',
204+
]

0 commit comments

Comments
 (0)