Skip to content
Merged
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'
Comment thread
afu5 marked this conversation as resolved.

- 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