From f0cdd79d79b0bffb479db6dc0c2455644f42a8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Thu, 8 Jan 2026 20:11:39 +0100 Subject: [PATCH 1/2] Use Codecov to report coverage --- .github/workflows/pipeline.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index cab65cd..cacfba9 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -194,3 +194,32 @@ jobs: run: | pip install . --no-deps --no-build-isolation python -m unittest discover tests + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup environment + shell: bash -l {0} + run: | + echo -e "channels:\n - conda-forge\n" > .condarc + sed '/- python/d' binder/environment.yml > environment.yml + echo '- coverage' >> environment.yml + - name: Setup Mambaforge + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: '3.12' + miniforge-version: latest + condarc-file: .condarc + environment-file: environment.yml + - name: Test + shell: bash -l {0} + timeout-minutes: 30 + run: | + pip install . --no-deps --no-build-isolation + coverage run -m unittest discover tests + coverage xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 3e99fc5eb25f942a5301fde5ba27ba1cb9704224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Thu, 8 Jan 2026 20:17:33 +0100 Subject: [PATCH 2/2] fix coverage calculation --- .github/workflows/pipeline.yml | 2 +- README.md | 1 + pyproject.toml | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index cacfba9..1b2865d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -217,7 +217,7 @@ jobs: timeout-minutes: 30 run: | pip install . --no-deps --no-build-isolation - coverage run -m unittest discover tests + coverage run coverage xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 diff --git a/README.md b/README.md index f9669c1..4c8f425 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Python Workflow Definition [![Pipeline](https://github.com/pythonworkflow/python-workflow-definition/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pythonworkflow/python-workflow-definition/actions/workflows/pipeline.yml) +[![codecov](https://codecov.io/github/pythonworkflow/python-workflow-definition/graph/badge.svg?token=3JXD1GN8LG)](https://codecov.io/github/pythonworkflow/python-workflow-definition) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pythonworkflow/python-workflow-definition/HEAD) [![DOI](https://zenodo.org/badge/945869529.svg)](https://doi.org/10.5281/zenodo.15516179) diff --git a/pyproject.toml b/pyproject.toml index e6dbe50..aa984f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,3 +35,7 @@ plot = [ "networkx>=2.8.8,<=3.5", "ipython>=7.33.0,<=9.8.0", ] + +[tool.coverage.run] +source = ["python_workflow_definition"] +command_line = "-m unittest discover tests" \ No newline at end of file