Skip to content

Commit

Permalink
Fixes #165 - sonarcloud coverage
Browse files Browse the repository at this point in the history
Generate `coverage.xml` and upload it to SonarCloud to fix the missing
coverage notice in SonarCloud's comments.
  • Loading branch information
rustydb committed Apr 20, 2023
1 parent 7ed67a0 commit 5c2b36b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,16 @@ jobs:
run: |
pip install .[ci]
nox -e tests
nox -e cover
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization="${GITHUB_REPOSITORY%/*}"
-Dsonar.projectKey="${GITHUB_REPOSITORY#*/}"
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.sources=canu/,network_modeling
-Dsonar.test.exclusions=tests/**
-Dsonar.tests=tests/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_version
pip-log.txt

# Unit test / coverage reports
.coverage
*coverage*
.nox
.tox
.cache
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def tests(session):
session.run(
"pytest",
"--log-level=ERROR",
"--cov-report=",
"--cov-report=xml",
f"--cov-fail-under={COVERAGE_FAIL}",
"--cov=canu",
"--cov=tests",
Expand Down

0 comments on commit 5c2b36b

Please sign in to comment.