From 305ca998767c8cdf76f878c0c587d0e654169ed0 Mon Sep 17 00:00:00 2001 From: Krishnan Shankar Date: Sun, 30 Jun 2024 15:02:03 -0400 Subject: [PATCH] Add coverage.py and coveralls.io integration to CI --- .github/workflows/ci.yml | 16 ++++++++++++++++ pyproject.toml | 15 +++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ce54dc1..4f37f48a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,22 @@ jobs: - name: Run Tests run: pipenv run python3 manage.py test + - name: Run Coveralls + uses: AndreMiras/coveralls-python-action@develop + with: + parallel: true + flag-name: Pyenv Unit Tests + + test_success: + needs: test + runs-on: ubuntu-latest + steps: + - name: Handle Coveralls Finish + uses: AndreMiras/coveralls-python-action@develop + with: + github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} + parallel-finished: true + docs: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index bd318d4c..a7cc33fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,13 +20,24 @@ packages = ["tin"] dependencies = { file = "requirements.txt" } [tool.pytest.ini_options] -DJANGO_SETTINGS_MODULE="tin.settings" -python_files="tests.py test_*.py *_tests.py" +DJANGO_SETTINGS_MODULE = "tin.settings" +python_files= "tests.py test_*.py *_tests.py" norecursedirs = ["media", "migrations", "sandboxing"] testpaths = "tin" addopts = "--doctest-modules tin --import-mode=importlib" doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER" +[tool.coverage.run] +branch = true +source = ["tin"] +omit = [ + "*/migrations/*", + "*/apps.py", + "*/urls.py", + "*/wsgi.py", +] +relative_files = true + [tool.black] line-length = 100 exclude = '''