Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 50 additions & 11 deletions .github/workflows/python-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,62 @@ jobs:
run: |
python3 -m coverage report

- name: Coverage lcov
- name: Coverage lcov (codecov)
run: |
python3 -m coverage lcov -o coverage/lcov.info

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
- name: Coverage xml (sonarcloud)
run: |
python3 -m coverage xml -o coverage/coverage.xml

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
name: coverage-report
path: coverage

- name: Coverage XML
run: |
python3 -m coverage xml
codecov:
name: Upload to Codecov
runs-on: ubuntu-24.04
needs: coverage

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@3cb13a12348ef4ffcf9783ac0f74954f92113e33
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

sonarqube:
name: Analyze with SonarQube
runs-on: ubuntu-24.04
needs: coverage

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage

- name: Analyze with SonarQube / SonarCloud
uses: SonarSource/sonarqube-scan-action@master
- name: SonarQube Scan
# yamllint disable-line rule:line-length
uses: SonarSource/sonarqube-scan-action@8c71dc039c2dd71d3821e89a2b58ecc7fee6ced9
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ test: env dependencies
coverage: test
${RUNTIME_TOOL} -m coverage lcov -o coverage/lcov.info

coverage/xml: test
${RUNTIME_TOOL} -m coverage xml -o coverage/coverage.xml

coverage/html: test
${RUNTIME_TOOL} -m coverage html
open htmlcov/index.html
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sonar.exclusions=**/*test.py,**/__init__.py
sonar.python.version=3.12

# Coverage
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.coverage.reportPaths=coverage/coverage.xml

# Ignore
sonar.issue.ignore.multicriteria=e1
Expand Down
Loading