Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new step to upload code coverage report to codecov #793

Merged
merged 6 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ jobs:
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
run: |
if [ "${{ matrix.python-version }}" != "pypy-3.10" ]; then
tox -- --cov=django_celery_beat --cov-report=xml --no-cov-on-fail --cov-report term
else
tox
fi
env:
DJANGO: ${{ matrix.django-version }}
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version != 'pypy-3.10' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Documentation/
.project
.pydevproject
.idea/
.vscode/
.coverage
celery/tests/cover/
.ve*
Expand Down
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,25 @@ lint.pylint.allow-magic-value-types = [
"str",
]
lint.pylint.max-args = 8 # Default: 5

[tool.coverage.run]
branch = true
cover_pylib = false
include = [ "*django_celery_beat/*" ]
omit = [ "django_celery_beat.tests.*" ]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"except ImportError:",
]
omit = [
"*/python?.?/*",
"*/site-packages/*",
"*/pypy/*",
"*/.tox/*",
"*/docker/*",
"*/docs/*",
"*/test_*.py",
]
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sitepackages = False
recreate = False
commands =
pip list
pytest -xv
pytest -xv {posargs}


[testenv:apicheck]
Expand Down