diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2acfdfd..6b74650 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,9 +44,24 @@ jobs: - name: Test with Pytest on Python ${{ matrix.python-version }} run: hatch run tests - - name: Upload coverage - uses: codecov/codecov-action@v2 - if: matrix.python-version == '3.10' + - name: Upload coverage data + uses: actions/upload-artifact@v4 + with: + name: coverage-data-${{ matrix.python-version }} + path: .coverage.* + if-no-files-found: ignore + include-hidden-files: true + + Coverage: + name: Coverage + needs: Pytest + 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: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 4c3e02f..3112dc1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![Tests](https://img.shields.io/github/actions/workflow/status/aphp/edspdf/tests.yml?branch=main&label=tests&style=flat-square) [![Documentation](https://img.shields.io/github/actions/workflow/status/aphp/edspdf/documentation.yml?branch=main&label=docs&style=flat-square)](https://aphp.github.io/edspdf/latest/) [![PyPI](https://img.shields.io/pypi/v/edspdf?color=blue&style=flat-square)](https://pypi.org/project/edspdf/) -[![Codecov](https://img.shields.io/codecov/c/github/aphp/edspdf?logo=codecov&style=flat-square)](https://codecov.io/gh/aphp/edspdf) +[![Coverage](https://raw.githubusercontent.com/aphp/edspdf/coverage/coverage.svg)](https://raw.githubusercontent.com/aphp/edspdf/coverage/coverage.txt) [![DOI](https://zenodo.org/badge/517726737.svg)](https://zenodo.org/badge/latestdoi/517726737) # EDS-PDF diff --git a/pyproject.toml b/pyproject.toml index 037daa3..8f00599 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ dependencies = [ ] [tool.hatch.envs.default.scripts] -tests = "pytest --cov=edspdf --cov-report=term-missing --cov-report=xml" +tests = "coverage run -m pytest" [tool.hatch.envs.docs] dependencies = [ @@ -141,13 +141,10 @@ whitelist-regex = [] color = true omit-covered-files = false -[tool.coverage.run] -concurrency = ["multiprocessing"] - [tool.coverage.report] -include = [ - "edspdf/*", -] +precision = 2 +include = ["edspdf/*"] +omit = ["tests/*"] exclude_lines = [ "def __repr__", "if __name__ == .__main__.:", @@ -163,6 +160,11 @@ exclude_lines = [ "@(abc\\.)?abstractmethod", ] +[tool.coverage.run] +include = ["edspdf/*"] +concurrency = ["multiprocessing", "thread"] +parallel = true + [tool.pytest.ini_options] testpaths = [ "tests",