forked from mathialm/secfit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Garima Ketan Chauhan
authored and
GitHub Enterprise
committed
Apr 2, 2025
1 parent
03d5807
commit be47f90
Showing
1 changed file
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,37 @@ | ||
| name: Django Coverage Report | ||
| name: Test Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - gargi-production | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - gargi-production | ||
|
|
||
| jobs: | ||
| coverage: | ||
| runs-on: self-hosted | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| - name: Check out code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Build test image | ||
| run: docker build -f tests/Dockerfile.test -t django-test-coverage-image . | ||
| working-directory: backend/ | ||
|
|
||
| - name: Run Django tests with coverage | ||
| run: docker run django-test-coverage-image | ||
| working-directory: backend/ | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: 3.9 | ||
|
|
||
| - name: Copy .coverage file | ||
| run: docker cp $(docker ps -aqf "ancestor=django-test-coverage-image"):/app/.coverage . | ||
| working-directory: backend/ | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r backend/requirements.txt | ||
| - name: Generate HTML coverage report | ||
| run: coverage html | ||
| working-directory: backend/ | ||
| - name: Run tests with coverage | ||
| working-directory: tests | ||
| run: | | ||
| docker build -t coverage-test -f Dockerfile.test . | ||
| docker run coverage-test | ||
| - name: Upload HTML coverage report | ||
| - name: Upload coverage results | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: coverage-report | ||
| path: backend/htmlcov/ # Adjusted path | ||
| name: coverage-results | ||
| path: tests/coverage.xml |