diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a1e13b41..cad32892 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -68,12 +68,25 @@ jobs: - name: Run tests shell: bash {0} run: ./build_tools/github/test.sh - - name: Upload coverage to CodeCov - uses: codecov/codecov-action@v3 + - name: Upload coverage data + uses: actions/upload-artifact@v4 + with: + name: coverage-data-${{ matrix.python-version }} + path: .coverage.* + if-no-files-found: ignore if: success() - name: Check dependencies licenses run: | liccheck + Coverage: + needs: Testing + uses: aphp/foldedtensor/.github/workflows/coverage.yml@main + with: + base-branch: main + coverage-data-pattern: coverage-data-* + coverage-report: coverage.txt + coverage-badge: coverage.svg + coverage-branch: coverage Documentation: needs: check_skip diff --git a/README.md b/README.md index 6e83f79d..13f79df7 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,15 @@ #

- - Documentation - - - Pipeline Status - - - Coverage - - - Black - - - - Supported Python versions - -DOI + +![Tests](https://img.shields.io/github/actions/workflow/status/aphp/eds-scikit/testing.yml?branch=main&label=tests&style=flat-square) +[![Documentation](https://img.shields.io/github/actions/workflow/status/aphp/eds-scikit/publish_doc.yml?branch=main&label=docs&style=flat-square)](https://aphp.github.io/eds-scikit/latest/) +[![PyPI](https://img.shields.io/pypi/v/eds-scikit?color=blue&style=flat-square)](https://pypi.org/project/eds-scikit/) +[![Supported Python](https://img.shields.io/badge/python-%3E%3D%203.7.1%20%7C%20%3C%203.8-brightgreen?style=flat-square)](https://www.python.org/) +[![Black](https://img.shields.io/badge/code%20style-black-black?style=flat-square)]([https://www.python.org/](https://github.com/psf/black)) +[![Coverage](https://codecov.io/github/aphp/eds-scikit/coverage.svg)](https://raw.githubusercontent.com/aphp/eds-scikit/coverage/coverage.txt) +[![DOI](https://zenodo.org/badge/571584236.svg)](https://zenodo.org/badge/latestdoi/571584236&style=flat-square) +

diff --git a/build_tools/github/test.sh b/build_tools/github/test.sh index f28f9358..282da92f 100755 --- a/build_tools/github/test.sh +++ b/build_tools/github/test.sh @@ -1,4 +1,4 @@ #!/bin/bash -x pip install -U "pip<23" -python -m pytest --pyargs tests -m "" --cov=eds_scikit +coverage run -m pytest diff --git a/pyproject.toml b/pyproject.toml index 28cb167f..43a6c4fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,3 +128,27 @@ unauthorized_licenses = [ dependencies = true optional_dependencies = ["dev", "doc"] as_regex = true + +[tool.coverage.report] +include = ["eds_scikit/*"] +omit = [ + "tests/*", +] +exclude_lines = [ + "def __repr__", + "if __name__ == .__main__.:", + "@overload", + "pragma: no cover", + "raise .*Error", + "raise .*Exception", + "warn\\(", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", + "class .*\\bProtocol\\):", + "@(abc\\.)?abstractmethod", +] + +[tool.coverage.run] +include = ["eds_scikit/*"] +concurrency = ["multiprocessing"] +parallel = true