Skip to content
Open
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,31 @@ jobs:
folder: pages/coverage
target-folder: coverage

publish-delta-coverage:
runs-on: ubuntu-latest

steps:

- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
Copy link
Copy Markdown
Contributor

@allison-li-1016 allison-li-1016 Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java corretto might be specific to AWS instances -- is there a reason why we specify this type of distribution?

Maybe someone should try building locally to see if this would work outside of an AWS instance as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This specification shouldn't affect building locally; it's part of the GitHub actions that happen when you push remotely. I took the distribution from the run-gradle-build job that is earlier in the file, so I think it's already being used. I'm not fully sure if it's needed here; I had this originally as a separate action/file, so I had to specify Java version, but I can see if it can be safely removed after putting it as part of an existing file. Thank you!


- name: Run delta coverage
run: ./gradlew test deltaCoverage

- name: Publish summary
run: cat build/reports/coverage-reports/delta-coverage/report.md >> $GITHUB_STEP_SUMMARY

- name: Add disclaimer
run: echo "The summary table will list class files and percent changes on each row, with totals at the bottom. If you have no class file changes, your totals will show NaN%. Run ./gradlew test deltaCoverage locally to view line-by-line changes. [Plugin Documentation](https://gw-kit.github.io/delta-coverage-plugin/stable/)" >> $GITHUB_STEP_SUMMARY

update-build-badges:
if: ${{ always() && github.ref == 'refs/heads/main' }}

Expand Down
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id "jacoco"
id "com.palantir.git-version" version "3.0.0"
id "com.diffplug.spotless" version "6.25.0"
id "io.github.surpsg.delta-coverage" version "2.5.0"
}

version = "3.3.0"
Expand Down Expand Up @@ -67,6 +68,18 @@ jacocoTestReport {
}
}

deltaCoverageReport {
diffSource {
diffSource.git.diffBase.set("refs/remotes/origin/main")
}

reports {
html.set(true)
xml.set(true)
markdown.set(true)
}
}

spotless {
java {
removeUnusedImports()
Expand Down
Loading