Skip to content

Commit 4a88d5a

Browse files
authored
ci: compile main sources before generating Coveralls report (#294)
* ci: compile main sources in coverage_report job The coverage_report job was producing an effectively empty jacocoTestReport.xml (3.4KB vs ~1.1MB locally) because no .class files existed when coverageReportOnly ran — the job checked out source code and downloaded .exec artifacts, but never compiled. JaCoCo's report generator skips packages/classes it cannot resolve, so the merged XML ended up with only <sessioninfo> entries and no <package> elements. That made coverallsJacoco silently no-op via the "source file set empty, skipping" branch in CoverallsReporter, so "Push coverage to Coveralls" reported success without uploading. Verified by downloading the coverage-report artifact from a recent run and comparing its XML structure against a local build's report. Assisted-By: Claude Code * ci: share compiled classes across jobs via artifact Eight jobs (build + 6 test + coverage_report) were each running their own ./gradlew compile chain on the same SHA, which is wasteful and was also the proximate cause of the silent Coveralls failure: the coverage_report job had no .class files at all because it never ran compileJava, so JaCoCo emitted a report with only <sessioninfo> and zero <package> entries, and coverallsJacoco short-circuited via its "source file set empty, skipping" branch. Compile once in the build job, upload **/build/classes/, generated/, and resources/ as a "compiled-classes" artifact (1-day retention), and download it in every dependent job before running tests or coverageReportOnly. Test jobs still invoke ./gradlew test; gradle's UP-TO-DATE check on the unchanged .java inputs picks up the restored outputs and skips the compile tasks. The coverage_report job now has real bytecode for JaCoCo to map exec data against, so the Coveralls upload actually contains source-file coverage. Verified locally that running coverageReportOnly with no .class files produces a 750-byte XML with only <sessioninfo>, while running it after compileJava (or with restored classes) produces a 1.1 MB XML with 54 <package> entries — matching the difference between CI's broken report and a healthy local one. Assisted-By: Claude Code * Revert "ci: share compiled classes across jobs via artifact" This reverts commit ecafc8c.
1 parent e1d3fc6 commit 4a88d5a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/java-ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ jobs:
445445
- name: Set up Gradle
446446
uses: gradle/actions/setup-gradle@v4
447447

448+
- name: Compile main sources
449+
run: ./gradlew compileJava
450+
448451
- name: Download coverage artifacts
449452
uses: actions/download-artifact@v4
450453
with:

0 commit comments

Comments
 (0)