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
8f71086
commit 7eaf876
Showing
1 changed file
with
24 additions
and
25 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,33 +1,32 @@ | ||
| name: Coverage Report Workflow | ||
| name: Run Tests with Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - gargi-production # Adjust the branch name as needed | ||
| - gargi-production # Trigger only for the gargi-production branch | ||
| pull_request: | ||
| branches: | ||
| - gargi-production # Trigger for PRs targeting gargi-production branch | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: self-hosted # You can change this to 'ubuntu-latest' if you're not using a self-hosted runner | ||
| test: | ||
| runs-on: self-hosted # Use self-hosted runner | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - name: Build Docker image | ||
| run: | | ||
| docker build --dns=8.8.8.8 -t secfit-backend-test -f backend/tests/dockerfile.test backend/tests | ||
| - name: Run tests with coverage | ||
| run: | | ||
| docker run --rm secfit-backend-test python manage.py test --coverage | ||
| - name: Upload Coverage Report | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: coverage.xml # Ensure your coverage tool generates this report | ||
| name: coverage-report | ||
| flags: coverage | ||
| fail_ci_if_error: true | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 # Checkout the code from the repository | ||
|
|
||
| - name: Set up Docker | ||
| uses: docker/setup-buildx-action@v2 # Set up Docker buildx to build Docker images | ||
|
|
||
| - name: Build Docker image for tests | ||
| run: docker build -f backend/tests/Dockerfile.test -t test-image . | ||
|
|
||
| - name: Run tests with coverage | ||
| run: docker run --rm test-image # Run the Docker container to execute the tests with coverage | ||
|
|
||
| - name: Upload coverage report | ||
| uses: codecov/codecov-action@v3 # Upload coverage report to Codecov | ||
| with: | ||
| file: coverage.xml # Specify the coverage file path | ||
|
|