Skip to content

Commit 0167b04

Browse files
committed
Enable test coverage
1 parent 141328b commit 0167b04

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/main.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ jobs:
6868
pytest --ignore ./tests/test_manifests.py
6969
env:
7070
LOADER: ${{ matrix.loader }}
71-
#coverage:
72-
# needs: [test]
73-
# FIXME
71+
coverage:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Set up Python
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: 3.12
80+
81+
- name: Install dependencies
82+
run: |
83+
pip install pytest pytest-cov
84+
85+
- name: Run tests with coverage
86+
run: |
87+
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt
88+
89+
- name: Pytest coverage comment
90+
uses: MishaKav/pytest-coverage-comment@main
91+
with:
92+
pytest-coverage-path: ./pytest-coverage.txt
93+
junitxml-path: ./pytest.xml

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ install:
44
pip install -e .
55

66
test:
7-
pytest
7+
pytest --cov=pyld
88

99
upgrade-submodules:
1010
git submodule update --remote --init --recursive

requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ruff
22
pytest
3+
pytest-cov

0 commit comments

Comments
 (0)