From 4f9695f7bdf2a7130d91917598b3c07b262eb03a Mon Sep 17 00:00:00 2001 From: thomashopkins32 Date: Fri, 20 Feb 2026 16:38:41 -0500 Subject: [PATCH 1/3] Add codecoverage --- .github/workflows/_testing.yml | 22 ++++++++++++++++++++-- README.md | 1 + pyproject.toml | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_testing.yml b/.github/workflows/_testing.yml index ba3f2aac..171ff0a1 100644 --- a/.github/workflows/_testing.yml +++ b/.github/workflows/_testing.yml @@ -35,7 +35,25 @@ jobs: activate-environment: ${{ matrix.python-version }} - name: Run unit tests - run: pixi run unit-tests + run: | + if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then + pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-report=xml --cov-report=term src/blop/tests/unit + else + pixi run unit-tests + fi - name: Run integration tests - run: pixi run integration-tests + run: | + if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then + pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-append --cov-report=xml --cov-report=term src/blop/tests/integration + else + pixi run integration-tests + fi + + - name: Upload coverage to Codecov + if: matrix.python-version == 'py312-cpu' + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + fail_ci_if_error: false + verbose: true diff --git a/README.md b/README.md index ec93945d..124434f3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Testing](https://github.com/NSLS-II/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/NSLS-II/blop/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/NSLS-II/blop/branch/main/graph/badge.svg)](https://codecov.io/gh/NSLS-II/blop) [![PyPI](https://img.shields.io/pypi/v/blop.svg)](https://pypi.python.org/pypi/blop) [![Conda](https://img.shields.io/conda/vn/conda-forge/blop.svg)](https://anaconda.org/conda-forge/blop) diff --git a/pyproject.toml b/pyproject.toml index fae747b5..ec1a9413 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ dynamic = ["version"] [project.optional-dependencies] dev = [ "pytest", + "pytest-cov", "ipykernel", "ruff", "nbstripout", From 9eb1bcd085a5c7599b38682ebe95f593b1eedb2c Mon Sep 17 00:00:00 2001 From: thomashopkins32 Date: Fri, 20 Feb 2026 16:41:47 -0500 Subject: [PATCH 2/3] Use commit hash for codecov action; Get report on py313 --- .github/workflows/_testing.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_testing.yml b/.github/workflows/_testing.yml index 171ff0a1..89ed58dd 100644 --- a/.github/workflows/_testing.yml +++ b/.github/workflows/_testing.yml @@ -36,7 +36,7 @@ jobs: - name: Run unit tests run: | - if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then + if [ "${{ matrix.python-version }}" = "py313-cpu" ]; then pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-report=xml --cov-report=term src/blop/tests/unit else pixi run unit-tests @@ -44,15 +44,15 @@ jobs: - name: Run integration tests run: | - if [ "${{ matrix.python-version }}" = "py312-cpu" ]; then + if [ "${{ matrix.python-version }}" = "py313-cpu" ]; then pixi run -e ${{ matrix.python-version }} pytest --cov=blop --cov-append --cov-report=xml --cov-report=term src/blop/tests/integration else pixi run integration-tests fi - name: Upload coverage to Codecov - if: matrix.python-version == 'py312-cpu' - uses: codecov/codecov-action@v4 + if: matrix.python-version == 'py313-cpu' + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: files: ./coverage.xml fail_ci_if_error: false From 31d7806fb700f93ecbb2fd4f9030996a6e57c0be Mon Sep 17 00:00:00 2001 From: thomashopkins32 Date: Fri, 20 Feb 2026 16:43:38 -0500 Subject: [PATCH 3/3] Use bluesky/blop links for badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 124434f3..00bf66fc 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Blop - Beamline Optimization Package -[![Testing](https://github.com/NSLS-II/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/NSLS-II/blop/actions/workflows/ci.yml) -[![codecov](https://codecov.io/gh/NSLS-II/blop/branch/main/graph/badge.svg)](https://codecov.io/gh/NSLS-II/blop) +[![Testing](https://github.com/bluesky/blop/actions/workflows/ci.yml/badge.svg)](https://github.com/bluesky/blop/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/bluesky/blop/branch/main/graph/badge.svg)](https://codecov.io/gh/bluesky/blop) [![PyPI](https://img.shields.io/pypi/v/blop.svg)](https://pypi.python.org/pypi/blop) [![Conda](https://img.shields.io/conda/vn/conda-forge/blop.svg)](https://anaconda.org/conda-forge/blop)