ci: SonarCloud analysis with JaCoCo coverage#7
Merged
Conversation
Add a daily/on-demand Sonar workflow (mirrors vortex-java): runs
./mvnw verify -P coverage plus the sonar-maven-plugin against
SonarCloud org dfa11, project dfa1_zstd-java.
- coverage profile attaches the JaCoCo agent via the @{argLine}
surefire placeholder and writes per-module jacoco.xml
- integration-tests aggregates IT coverage onto the zstd classes it
exercises (report-aggregate); its zstd dep moves to compile scope so
those classes enter the aggregate (module is never published)
- Sonar reads both the per-module and aggregate reports
- README: Quality Gate + Coverage badges
Requires (manual, repo side): create project dfa1_zstd-java on
SonarCloud and add the SONAR_TOKEN repo secret.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Enables SonarCloud static analysis + coverage, mirroring
../vortex-java..github/workflows/sonar.yml— daily (07:00 UTC) +workflow_dispatch. Runs./mvnw verify -P coveragethensonar-maven-plugin:sonar. Kept out of per-push CI to keep PRs fast / save quota.coverageprofile (parent pom) — attaches the JaCoCo agent through the@{argLine}surefire placeholder (--enable-native-accessflag preserved), writes per-modulejacoco.xml.report-aggregatereports IT coverage onto thezstdclasses the integration tests exercise. Thezstddep moves to compile scope so its classes enter the aggregate (this module is never published —maven.deploy.skip=true).projectKey=dfa1_zstd-java,organization=dfa11, both report paths,benchmarkexcluded from coverage.Manual steps to actually turn it on
dfa1_zstd-javaunder SonarCloud orgdfa11.SONAR_TOKEN.Test
./mvnw -P coverage verify -pl integration-tests -am— green;zstd/target/site/jacoco/jacoco.xml(133 KB) +integration-tests/target/site/jacoco-aggregate/jacoco.xml(133 KB, includesio/github/dfa1/zstdclasses) produced../mvnw teststill green —@{argLine}resolves empty without JaCoCo.🤖 Generated with Claude Code