From 24f9e84577b0841dc775974efde0e3d267f8f267 Mon Sep 17 00:00:00 2001 From: Garima Ketan Chauhan Date: Wed, 2 Apr 2025 13:11:40 +0200 Subject: [PATCH] Coverage-workflow.yml --- .github/workflows/coverage-workflow.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/coverage-workflow.yml diff --git a/.github/workflows/coverage-workflow.yml b/.github/workflows/coverage-workflow.yml new file mode 100644 index 0000000..c1eaf71 --- /dev/null +++ b/.github/workflows/coverage-workflow.yml @@ -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/