Skip to content

ci: SonarCloud analysis with JaCoCo coverage#7

Merged
dfa1 merged 1 commit into
mainfrom
ci/sonarcloud-coverage
Jun 26, 2026
Merged

ci: SonarCloud analysis with JaCoCo coverage#7
dfa1 merged 1 commit into
mainfrom
ci/sonarcloud-coverage

Conversation

@dfa1

@dfa1 dfa1 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What

Enables SonarCloud static analysis + coverage, mirroring ../vortex-java.

  • .github/workflows/sonar.yml — daily (07:00 UTC) + workflow_dispatch. Runs ./mvnw verify -P coverage then sonar-maven-plugin:sonar. Kept out of per-push CI to keep PRs fast / save quota.
  • coverage profile (parent pom) — attaches the JaCoCo agent through the @{argLine} surefire placeholder (--enable-native-access flag preserved), writes per-module jacoco.xml.
  • integration-tests aggregatereport-aggregate reports IT coverage onto the zstd classes the integration tests exercise. The zstd dep moves to compile scope so its classes enter the aggregate (this module is never published — maven.deploy.skip=true).
  • Sonar props in parent pom: projectKey=dfa1_zstd-java, organization=dfa11, both report paths, benchmark excluded from coverage.
  • README — Quality Gate + Coverage badges.

Manual steps to actually turn it on

  1. Create project dfa1_zstd-java under SonarCloud org dfa11.
  2. Add repo secret SONAR_TOKEN.
  3. Run the workflow once via Actions → Sonar → Run workflow (or wait for the 07:00 UTC cron).

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, includes io/github/dfa1/zstd classes) produced.
  • Non-coverage ./mvnw test still green — @{argLine} resolves empty without JaCoCo.

🤖 Generated with Claude Code

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>
@dfa1 dfa1 merged commit c73efae into main Jun 26, 2026
1 check passed
@dfa1 dfa1 deleted the ci/sonarcloud-coverage branch June 26, 2026 15:57
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.

1 participant