Skip to content

Commit 2ff92fe

Browse files
authored
Add codecoverage (#246)
* Add codecoverage * Use commit hash for codecov action; Get report on py313 * Use bluesky/blop links for badges
1 parent 6c49af2 commit 2ff92fe

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

.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 }}" = "py313-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 }}" = "py313-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 == 'py313-cpu'
55+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
56+
with:
57+
files: ./coverage.xml
58+
fail_ci_if_error: false
59+
verbose: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Blop - Beamline Optimization Package
22

33

4-
[![Testing](https://github.com/NSLS-II/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/NSLS-II/blop/actions/workflows/ci.yml)
4+
[![Testing](https://github.com/bluesky/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/bluesky/blop/actions/workflows/ci.yml)
5+
[![codecov](https://codecov.io/gh/bluesky/blop/branch/main/graph/badge.svg)](https://codecov.io/gh/bluesky/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)