ci: add coverage report and sonarcloud scan on PRs#206
Merged
Conversation
ced03ae to
f6148d7
Compare
There was a problem hiding this comment.
Pull request overview
Adds CI support for generating Python coverage reports and running a SonarCloud scan on PRs and pushes to main, using a reusable test workflow.
Changes:
- Add
sonar-project.propertiesfor SonarCloud project configuration and coverage ingestion. - Configure
coverage.pyviapyproject.tomland generate/upload coverage HTML + XML artifacts from a single matrix cell (Ubuntu / Python 3.13). - Add a
sonarcloudjob to the reusable test workflow and passSONAR_TOKENfrom the top-level CI workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sonar-project.properties |
Defines SonarCloud project metadata, source/test paths, and coverage report path. |
pyproject.toml |
Adds coverage.py run/report configuration for consistent XML/HTML output. |
.github/workflows/test.yml |
Generates coverage in one matrix cell, uploads artifacts, and adds a SonarCloud scan job. |
.github/workflows/ci.yml |
Passes SONAR_TOKEN into the reusable test.yml workflow. |
Comments suppressed due to low confidence (1)
.github/workflows/test.yml:68
- The SonarCloud job condition
needs.test.result != 'failure'is ineffective while thetestjob hascontinue-on-error: true(GitHub Actions will not mark the needed job asfailureeven if pytest fails). This can cause SonarCloud to run (and the workflow to appear successful) despite failing tests; consider removingcontinue-on-errorfor the test matrix or tightening the condition so SonarCloud only runs when tests truly succeeded.
needs: test
runs-on: ubuntu-latest
if: always() && needs.test.result != 'failure'
permissions:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: SonarCloud | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| if: always() && needs.test.result != 'failure' |
|
radugheo
approved these changes
May 18, 2026
7 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
sonar-project.propertiesand asonarcloudjob that runs after tests