Skip to content

ci: add coverage report and sonarcloud scan on PRs#206

Merged
radu-mocanu merged 1 commit into
mainfrom
ci/sonarcloud
May 18, 2026
Merged

ci: add coverage report and sonarcloud scan on PRs#206
radu-mocanu merged 1 commit into
mainfrom
ci/sonarcloud

Conversation

@radu-mocanu
Copy link
Copy Markdown
Collaborator

@radu-mocanu radu-mocanu commented May 18, 2026

Summary

  • adds sonar-project.properties and a sonarcloud job that runs after tests
  • coverage runs only on the ubuntu/3.13 matrix cell and uploads xml + html artifacts

Copilot AI review requested due to automatic review settings May 18, 2026 13:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.properties for SonarCloud project configuration and coverage ingestion.
  • Configure coverage.py via pyproject.toml and generate/upload coverage HTML + XML artifacts from a single matrix cell (Ubuntu / Python 3.13).
  • Add a sonarcloud job to the reusable test workflow and pass SONAR_TOKEN from 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 the test job has continue-on-error: true (GitHub Actions will not mark the needed job as failure even if pytest fails). This can cause SonarCloud to run (and the workflow to appear successful) despite failing tests; consider removing continue-on-error for 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'
@sonarqubecloud
Copy link
Copy Markdown

@radu-mocanu radu-mocanu merged commit fb057ba into main May 18, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants