File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,12 @@ jobs:
5656 - name : Run Migrations
5757 run : python manage.py migrate
5858
59- - name : Run Tests with Coverage
60- run : |
61- coverage run manage.py test
62- coverage report
63- coverage html # Generates the HTML report in 'htmlcov' directory
59+ # Generate coverage XML report for Codecov
60+ - name : Run tests and generate coverage XML report
61+ run : pytest --cov --cov-branch --cov-report=xml
6462
65- # Upload coverage HTML report as artifact
66- - name : Upload coverage HTML report
67- uses : actions/upload-artifact@v4
63+ # Upload to Codecov (external visualization tool)
64+ - name : Upload coverage reports to Codecov
65+ uses : codecov/codecov-action@v5
6866 with :
69- name : coverage-report-html
70- path : backend/htmlcov/ # Upload the entire 'htmlcov' directory
71-
67+ token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -22,4 +22,7 @@ pytest==8.1.1
2222pytest-django == 4.8.0
2323pytest-asyncio == 0.23.5
2424factory-boy == 3.3.0
25- coverage == 7.5.0
25+ coverage == 7.5.0
26+
27+ # Dev dependencies
28+ pytest-cov == 6.1.1
Original file line number Diff line number Diff line change 1+ # pytest.ini
2+ [pytest]
3+ DJANGO_SETTINGS_MODULE = backend.settings
4+ python_files = tests.py
You can’t perform that action at this time.
0 commit comments