diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 234cb667..069ec0ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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) diff --git a/.gitignore b/.gitignore index 5d78f439..81f3b75d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ Documentation/ .project .pydevproject .idea/ +.vscode/ .coverage celery/tests/cover/ .ve* diff --git a/pyproject.toml b/pyproject.toml index b6729577..6e4f9b69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", +] diff --git a/tox.ini b/tox.ini index 0b2e7380..75b5ef6f 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ sitepackages = False recreate = False commands = pip list - pytest -xv + pytest -xv {posargs} [testenv:apicheck]