Skip to content

Commit

Permalink
Coverage-workflow.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Garima Ketan Chauhan authored and GitHub Enterprise committed Apr 2, 2025
1 parent f180a13 commit 24f9e84
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Django Coverage Report

on:
push:
branches:
- gargi-production # Or any other branch you want to run coverage on
pull_request: # Also run on pull requests
branches:
- gargi-production

jobs:
coverage:
runs-on: self-hosted

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build test image
run: docker build -f Dockerfile.test -t django-test-coverage-image .

- name: Run Django tests with coverage
run: docker run django-test-coverage-image

- name: Copy .coverage file
run: docker cp $(docker ps -aqf "ancestor=django-test-coverage-image"):/app/.coverage .

- name: Generate HTML coverage report
run: coverage html

- name: Upload HTML coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: htmlcov/

0 comments on commit 24f9e84

Please sign in to comment.