Skip to content

Integrate JaCoCo coverage into CodeQL analysis with 90% instruction coverage gate - #388

Draft
rashidi with Copilot wants to merge 4 commits into
masterfrom
copilot/update-jacoco-integration-codeql
Draft

Integrate JaCoCo coverage into CodeQL analysis with 90% instruction coverage gate#388
rashidi with Copilot wants to merge 4 commits into
masterfrom
copilot/update-jacoco-integration-codeql

Conversation

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Wires JaCoCo XML coverage reports into the CodeQL workflow and enforces a 90% instruction coverage minimum that fails CI — blocking merges — when the threshold isn't met.

build.gradle.kts

  • Adds a root-level JacocoCoverageVerification task (testCodeCoverageVerification) enforcing ≥ 90% instruction coverage across all submodules against the aggregated jacoco-report-aggregation report
  • Hooks the verification into tasks.check so both the gradle-build and CodeQL workflows enforce it on every run
val coverageVerification = tasks.register<JacocoCoverageVerification>("testCodeCoverageVerification") {
    dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
    violationRules {
        rule {
            limit {
                counter = "INSTRUCTION"
                minimum = "0.90".toBigDecimal()
            }
        }
    }
    ...
}

tasks.check {
    dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
    dependsOn(coverageVerification)
}

.github/workflows/codeql.yml

  • Switches build-mode from autobuildmanual; the manual build step runs ./gradlew check which produces the aggregated JaCoCo XML report
  • Passes the report to codeql-action/analyze via coverage-report so CodeQL embeds coverage percentage in its SARIF output
  • Sets upload: always so coverage is reported on every run, not just failures

Copilot AI and others added 3 commits August 29, 2026 14:02
Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
…alysis

- Add JacocoCoverageVerification task to root build.gradle.kts that fails
  the build when instruction coverage drops below 90%, blocking merges via CI
- Wire the aggregated JaCoCo XML report into codeql-action/analyze via the
  coverage-report input so CodeQL sees coverage data
- Remove leftover dead `if: false` steps from codeql.yml

Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Set upload: always on the analyze step so the SARIF result (which
includes the JaCoCo coverage percentage via coverage-report) is uploaded
to GitHub on every run, not only on failure.

Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions for JaCoCo coverage integration with CodeQL Integrate JaCoCo coverage into CodeQL analysis with 90% instruction coverage gate Aug 29, 2026
Copilot AI requested a review from rashidi August 29, 2026 14:05
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.

2 participants