Skip to content

Commit 39e398e

Browse files
authored
Merge pull request #135 from DCC-Lab/jlb/coverage
Add test coverage to CI
2 parents 8e3c907 + 7cc013e commit 39e398e

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Coverage
2+
3+
on: [ pull_request, workflow_dispatch ]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Linux packages for Qt5/Qt6 support and start Xvfb
14+
uses: pyvista/setup-headless-display-action@v3
15+
with:
16+
qt: true
17+
18+
- name: Linux OpenCL support
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y pocl-opencl-icd ocl-icd-opencl-dev gcc clinfo
22+
clinfo
23+
24+
- name: Set up Python 3.11
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.11
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e .[dev]
33+
34+
- name: Run tests with coverage
35+
env:
36+
PTO_CI_MODE: 1
37+
run: |
38+
pytest -v --cov=pytissueoptics --cov-report=xml --cov-report=html
39+
40+
- name: Upload coverage report
41+
uses: codecov/codecov-action@v4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ dependencies = [
3535
[project.optional-dependencies]
3636
dev = [
3737
"mockito",
38-
"coverage",
3938
"pytest",
39+
"pytest-cov",
4040
"ruff",
4141
]
4242

0 commit comments

Comments
 (0)