Skip to content

Commit 4f9695f

Browse files
committed
Add codecoverage
1 parent 6c49af2 commit 4f9695f

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/_testing.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,25 @@ jobs:
3535
activate-environment: ${{ matrix.python-version }}
3636

3737
- name: Run unit tests
38-
run: pixi run unit-tests
38+
run: |
39+
if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then
40+
pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-report=xml --cov-report=term src/blop/tests/unit
41+
else
42+
pixi run unit-tests
43+
fi
3944
4045
- name: Run integration tests
41-
run: pixi run integration-tests
46+
run: |
47+
if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then
48+
pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-append --cov-report=xml --cov-report=term src/blop/tests/integration
49+
else
50+
pixi run integration-tests
51+
fi
52+
53+
- name: Upload coverage to Codecov
54+
if: matrix.python-version == 'py312-cpu'
55+
uses: codecov/codecov-action@v4
56+
with:
57+
files: ./coverage.xml
58+
fail_ci_if_error: false
59+
verbose: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
[![Testing](https://github.com/NSLS-II/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/NSLS-II/blop/actions/workflows/ci.yml)
5+
[![codecov](https://codecov.io/gh/NSLS-II/blop/branch/main/graph/badge.svg)](https://codecov.io/gh/NSLS-II/blop)
56
[![PyPI](https://img.shields.io/pypi/v/blop.svg)](https://pypi.python.org/pypi/blop)
67
[![Conda](https://img.shields.io/conda/vn/conda-forge/blop.svg)](https://anaconda.org/conda-forge/blop)
78

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dynamic = ["version"]
4646
[project.optional-dependencies]
4747
dev = [
4848
"pytest",
49+
"pytest-cov",
4950
"ipykernel",
5051
"ruff",
5152
"nbstripout",

0 commit comments

Comments
 (0)