Skip to content

Commit

Permalink
Merge pull request #429 from bioimage-io/add_coverage
Browse files Browse the repository at this point in the history
add coverage reporting
  • Loading branch information
FynnBe authored Oct 29, 2024
2 parents 646546f + dcdbffe commit 7bb680c
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ jobs:
run: pip install --no-deps -e .
- name: pytest-spec-main
run: pytest --disable-pytest-warnings
- if: matrix.python-version == '3.12' && github.event_name == 'pull_request'
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
- if: matrix.python-version == '3.12' && github.ref == 'refs/heads/main'
run: |
pip install genbadge[coverage]
genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg
coverage html -d dist/coverage
- if: matrix.python-version == '3.12' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: coverage
retention-days: 1
path: dist


test-tf:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -140,6 +157,10 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: coverage
path: dist
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__pycache__/
.coverage
.env
.idea/
.tox/
Expand All @@ -6,6 +8,7 @@
**/tmp
build/
cache
coverage.xml
dist/
docs/
typings/pooch/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![downloads](https://static.pepy.tech/badge/bioimageio.core)](https://pepy.tech/project/bioimageio.core)
[![conda-forge downloads](https://img.shields.io/conda/dn/conda-forge/bioimageio.core.svg?label=conda-forge)](https://anaconda.org/conda-forge/bioimageio.core/)
![code style](https://img.shields.io/badge/code%20style-black-000000.svg)
[![coverage](https://bioimage-io.github.io/core-bioimage-io-python/coverage/coverage-badge.svg)](https://bioimage-io.github.io/core-bioimage-io-python/coverage/index.html)

# core-bioimage-io-python

Expand Down
1 change: 1 addition & 0 deletions dev/env-py38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- pydantic-settings
- pyright
- pytest
- pytest-cov
- pytest-xdist
- python-dotenv
- python=3.8 # changed
Expand Down
1 change: 1 addition & 0 deletions dev/env-tf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- pydantic-settings
- pyright
- pytest
- pytest-cov
- pytest-xdist
- python-dotenv
# - python=3.9 # removed
Expand Down
1 change: 1 addition & 0 deletions dev/env-wo-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- pydantic-settings
- pyright
- pytest
- pytest-cov
- pytest-xdist
- python-dotenv
# - python=3.9 # removed
Expand Down
1 change: 1 addition & 0 deletions dev/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- pydantic-settings
- pyright
- pytest
- pytest-cov
- pytest-xdist
- python-dotenv
- python=3.9
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typeCheckingMode = "strict"
useLibraryCodeForTypes = true

[tool.pytest.ini_options]
addopts = " -n auto --capture=no --doctest-modules --failed-first"
addopts = "--cov=bioimageio --cov-report=xml -n auto --capture=no --doctest-modules --failed-first"

[tool.ruff]
line-length = 88
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"pdoc",
"psutil", # parallel pytest with 'pytest -n auto'
"pyright",
"pytest-cov",
"pytest-xdist", # parallel pytest
"pytest",
"torch>=1.6",
Expand Down

0 comments on commit 7bb680c

Please sign in to comment.