Skip to content

Commit 0d8aec0

Browse files
authored
Merge pull request #120 from anx-bhagmann/coverage
Add code coverage to main GitHub workflow and upload to Codecov
2 parents 1ed89f2 + e7c4c6e commit 0d8aec0

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip
50-
pip install flake8
50+
pip install flake8 codecov
5151
5252
- name: Lint with flake8
5353
run: |
@@ -73,9 +73,21 @@ jobs:
7373
7474
- name: Setup environment
7575
run: |
76+
pip install -e .
7677
python setup.py install
7778
7879
- name: Run tests
7980
run: |
80-
cd tests
81-
python manage.py test
81+
# prepare Django project: link all necessary data from the test project into the root directory
82+
# Hint: Simply changing the directory does not work (leads to missing files in coverage report)
83+
ln -s ./tests/test test
84+
ln -s ./tests/manage.py manage.py
85+
ln -s ./tests/settings.py settings.py
86+
ln -s ./tests/urls.py urls.py
87+
88+
# run tests with coverage
89+
coverage run --source='./django_rest_passwordreset' manage.py test
90+
coverage xml
91+
92+
- name: Upload coverage to Codecov
93+
uses: codecov/codecov-action@v1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![PyPI version](https://img.shields.io/pypi/v/django-rest-passwordreset.svg)](https://pypi.org/project/django-rest-passwordreset/)
44
[![build-and-test actions status](https://github.com/anexia-it/django-rest-passwordreset/workflows/build-and-test/badge.svg)](https://github.com/anexia-it/django-rest-passwordreset/actions)
5+
[![Codecov](https://img.shields.io/codecov/c/gh/anexia-it/django-rest-passwordreset)](https://codecov.io/gh/anexia-it/django-rest-passwordreset)
56

67
This python package provides a simple password reset strategy for django rest framework, where users can request password
78
reset tokens via their registered e-mail address.

0 commit comments

Comments
 (0)