Repository navigation
ci: add SonarQube coverage workflow - #12
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a SonarQube/SonarCloud GitHub Actions workflow that runs test coverage and a Sonar scan, pins GitHub Action references to exact SHAs in CI and release workflows, and adds a Codecov configuration. ChangesCI workflows + SonarQube
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions Runner
participant Checkout as actions/checkout (fetch-depth: 0)
participant SetupGo as actions/setup-go (from go.mod, cache)
participant Task as arduino/setup-task
participant SonarAction as SonarSource/sonarqube-scan-action
participant SonarCloud as SonarCloud
Runner->>Checkout: checkout repository (full history)
Runner->>SetupGo: setup Go environment
Runner->>Task: install Task & run `task test-coverage`
Runner->>SonarAction: invoke Sonar scan (SONAR_TOKEN, -Dsonar.* args, coverage.out)
SonarAction->>SonarCloud: upload analysis and coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/sonarqube.yml:
- Around line 38-43: The SonarQube Scan step ("SonarQube Scan" using
SonarSource/sonarqube-scan-action@v7) must be skipped for forked PRs because
secrets.SONAR_TOKEN won't be available; add an if: guard that only runs the step
when it's not a pull_request or when the PR head repo matches the base repo
(e.g. if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) so the step
runs in normal branches/owner PRs but is skipped for forked PRs that lack the
SONAR_TOKEN env var.
- Around line 22-23: Replace mutable action tags with immutable commit SHAs:
locate every "uses: actions/checkout@v6" (and the other "uses:" entries in this
workflow and the other CI/release workflows) and change the tag to the
corresponding full commit SHA for that action release; ensure you update all
occurrences (the checkout action and any other referenced actions) to their
pinned SHAs, run a quick CI lint to validate the YAML, and commit the updated
workflow files so the workflows reference immutable, auditable action SHAs
instead of major-version tags.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 05e1796e-c2e5-459e-89d0-9fcd20f9dc52
📒 Files selected for processing (1)
.github/workflows/sonarqube.yml
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|



Summary
Validation