File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -53,19 +53,16 @@ jobs:
5353 echo "CLOUDINARY_API_SECRET=${{ secrets.CLOUDINARY_API_SECRET }}" >> .env
5454 shell : bash
5555
56+ # Applying migrations
5657 - name : Run Migrations
5758 run : python manage.py migrate
5859
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
60+ # Generate coverage XML report for Codecov
61+ - name : Run tests and generate coverage XML report
62+ run : pytest --cov --cov-branch --cov-report=xml
6463
65- # Upload coverage HTML report as artifact
66- - name : Upload coverage HTML report
67- uses : actions/upload-artifact@v4
64+ # Upload to Codecov (external visualization tool)
65+ - name : Upload coverage reports to Codecov
66+ uses : codecov/codecov-action@v5
6867 with :
69- name : coverage-report-html
70- path : backend/htmlcov/ # Upload the entire 'htmlcov' directory
71-
68+ 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