Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravpatel67 authored Nov 18, 2024
1 parent c22b0c6 commit fbb3e08
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,31 @@ jobs:
run: |
tox -e py
continue-on-error: true


- name: Upload pytest results
run: |
pytest --maxfail=1 --disable-warnings --junitxml=pytest-results.xml
if: failure() # Ensure this runs regardless of tox or coverage step result
continue-on-error: true

- name: Generate coverage report
run: |
coverage xml # This generates the coverage report after tox runs, even if tox fails
if: always() # This ensures the report is generated even if the previous step failed

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Upload pytest results
run: |
pytest --maxfail=1 --disable-warnings --junitxml=pytest-results.xml
if: always() # Ensure this runs regardless of tox or coverage step result



# Upload the coverage report as an artifact (optional)
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage.xml # Path to the coverage XML report

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

0 comments on commit fbb3e08

Please sign in to comment.