Skip to content

Commit d20ac6b

Browse files
committed
Enable testing and reporting coverage
1 parent 8195743 commit d20ac6b

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

.github/workflows/main.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,32 @@ 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+
permissions:
74+
contents: read # For checkout and comparing commits
75+
pull-requests: write # For creating/updating PR comments
76+
steps:
77+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
78+
with:
79+
submodules: recursive
80+
persist-credentials: false
81+
- name: Set up Python
82+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
83+
with:
84+
python-version: 3.12
85+
- name: Install dependencies
86+
run: |
87+
python -m pip install --upgrade pip
88+
pip install -r requirements.txt
89+
- name: Install testing dependencies
90+
run: |
91+
pip install -r requirements-test.txt
92+
- name: Run tests with coverage
93+
run: |
94+
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyld tests/ | tee pytest-coverage.txt
95+
- name: Pytest coverage comment
96+
uses: MishaKav/pytest-coverage-comment@ae0e8a539a3f310aefb3bfb6a2209778a21fa42b
97+
with:
98+
pytest-coverage-path: ./pytest-coverage.txt
99+
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)