diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..0fe8f6a --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,33 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true + + # Report coverage for all files, even if not touched in PR + report: + exclude_labels: + - "skip-coverage" + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: false + +# Files to ignore in coverage +ignore: + - "tests/*" + - "**/__pycache__/*" + - "**/htmlcov/*" + - "setup.py" + +# GitHub Checks integration +github_checks: + annotations: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3a0428..23e5526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,15 +39,14 @@ jobs: - name: Run tests run: | - pytest -v --cov=tzst --cov-report=xml + pytest --cov=tzst --cov-branch --cov-report=xml - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' uses: codecov/codecov-action@v5 with: - file: ./coverage.xml - flags: unittests - name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }} + slug: xixu-me/tzst build: needs: test diff --git a/README.md b/README.md index 68a638a..b784aca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # tzst +[![codecov](https://codecov.io/gh/xixu-me/tzst/graph/badge.svg?token=2AIN1559WU)](https://codecov.io/gh/xixu-me/tzst) [![CodeQL](https://github.com/xixu-me/tzst/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/xixu-me/tzst/actions/workflows/github-code-scanning/codeql) [![CI/CD](https://github.com/xixu-me/tzst/actions/workflows/ci.yml/badge.svg)](https://github.com/xixu-me/tzst/actions/workflows/ci.yml) [![PyPI - Version](https://img.shields.io/pypi/v/tzst)](https://pypi.org/project/tzst/) diff --git a/pyproject.toml b/pyproject.toml index b013282..1a28810 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ testpaths = ["tests"] python_files = ["test_*.py"] python_classes = ["Test*"] python_functions = ["test_*"] -addopts = "--cov=tzst --cov-report=term-missing --cov-report=html" +addopts = "--cov --cov-report=term-missing --cov-report=html" markers = ["integration: marks tests as integration tests"] [tool.ruff]