Skip to content

Commit 59459d2

Browse files
Merge pull request #153 from UNLV-CS472-672/ci-pipelin-improvements
improving ci-pipeline (quick fix)
2 parents 1fb8fa4 + f7eea4a commit 59459d2

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/django_ci_cd.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff 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 }}

backend/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ pytest==8.1.1
2222
pytest-django==4.8.0
2323
pytest-asyncio==0.23.5
2424
factory-boy==3.3.0
25-
coverage==7.5.0
25+
coverage==7.5.0
26+
27+
# Dev dependencies
28+
pytest-cov==6.1.1

pytest.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# pytest.ini
2+
[pytest]
3+
DJANGO_SETTINGS_MODULE = backend.settings
4+
python_files = tests.py

0 commit comments

Comments
 (0)