Skip to content

Commit 5b936a7

Browse files
test: Add coverage and codecov bot
1 parent 88b4176 commit 5b936a7

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

.codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
status:
3+
project:
4+
default: false
5+
tests:
6+
paths: tests
7+
informational: true
8+
knox:
9+
paths: knox
10+
informational: true
11+
patch: off

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
branch = True
3+
source = knox
4+
omit =
5+
*/migrations/*

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ jobs:
3636
- name: Install dependencies
3737
run: |
3838
python -m pip install --upgrade pip
39-
python -m pip install --upgrade tox tox-gh-actions
39+
python -m pip install --upgrade tox tox-gh-actions coverage
4040
4141
- name: Tox tests
4242
run: |
4343
tox -v
44+
45+
- name: Generate coverage XML report
46+
run: coverage xml
47+
48+
- name: Codecov
49+
uses: codecov/codecov-action@v3

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ commands = isort --check-only --diff \
2222
[testenv]
2323
commands =
2424
python manage.py migrate
25-
python manage.py test
25+
coverage run manage.py test
26+
coverage report
2627
setenv =
2728
DJANGO_SETTINGS_MODULE = knox_project.settings
2829
PIP_INDEX_URL = https://pypi.python.org/simple/
@@ -38,6 +39,7 @@ deps =
3839
setuptools
3940
twine
4041
wheel
42+
coverage
4143

4244
[gh-actions]
4345
python =

0 commit comments

Comments
 (0)