Skip to content

Commit

Permalink
test: Add coverage and codecov bot
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannicimolin committed Aug 15, 2023
1 parent 88b4176 commit 5b936a7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default: false
tests:
paths: tests
informational: true
knox:
paths: knox
informational: true
patch: off
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
branch = True
source = knox
omit =
*/migrations/*
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
python -m pip install --upgrade tox tox-gh-actions coverage
- name: Tox tests
run: |
tox -v
- name: Generate coverage XML report
run: coverage xml

- name: Codecov
uses: codecov/codecov-action@v3
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ commands = isort --check-only --diff \
[testenv]
commands =
python manage.py migrate
python manage.py test
coverage run manage.py test
coverage report
setenv =
DJANGO_SETTINGS_MODULE = knox_project.settings
PIP_INDEX_URL = https://pypi.python.org/simple/
Expand All @@ -38,6 +39,7 @@ deps =
setuptools
twine
wheel
coverage

[gh-actions]
python =
Expand Down

0 comments on commit 5b936a7

Please sign in to comment.