From cf4b077c455db88f4f97926b06597a6ba1056072 Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:08:14 +0200 Subject: [PATCH 1/7] release 1.1.0 --- .github/workflows/release.yml | 21 ++----- CHANGELOG.md | 8 +++ pom.xml | 4 +- src/it/latest-java-class-support/pom.xml | 55 +++++++++++++++++++ .../src/main/java/com/test/Example.java | 14 +++++ .../src/test/java/com/test/ExampleTest.java | 11 ++++ src/it/latest-java-class-support/verify.bsh | 13 +++++ 7 files changed, 108 insertions(+), 18 deletions(-) create mode 100644 src/it/latest-java-class-support/pom.xml create mode 100644 src/it/latest-java-class-support/src/main/java/com/test/Example.java create mode 100644 src/it/latest-java-class-support/src/test/java/com/test/ExampleTest.java create mode 100644 src/it/latest-java-class-support/verify.bsh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab9535a..de12e63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,36 +1,25 @@ -# This is a basic workflow to help you get started with Actions +name: 🚀 Release -name: Release on: release: types: [prereleased, released] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" release: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v6 + - name: 📥 Checkout + uses: actions/checkout@v6 with: fetch-depth: 0 - - name: Set up JDK + - name: ☕ Set up JDK uses: actions/setup-java@v5 with: distribution: 'adopt' java-version: '11' cache: 'maven' - - name: Build with Maven + - name: 🔨 Build with Maven run: mvn install --file pom.xml -e - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: target/site/jacoco-fullCoverage/jacoco.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ab6401..71b8be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Diff-Coverage Maven plugin +## 1.1.0 + +- Added Java 25 class files support + +### Dependencies updates +- JaCoCo 0.8.14 +- delta-coverage-core 3.6.0 + ## 1.0.0 - Changed group id from `com.github.surpsg` to `io.github.surpsg` diff --git a/pom.xml b/pom.xml index 2940821..140bd6f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ diff-coverage-maven-plugin ${project.groupId}:${project.artifactId} maven-plugin - 1.0.0 + 1.1.0 Diff coverage maven plugin builds code coverage report of new and modified code based on a provided diff @@ -61,7 +61,7 @@ 0.8.14 3.6.0 - 1.0.0 + 1.1.0 diff --git a/src/it/latest-java-class-support/pom.xml b/src/it/latest-java-class-support/pom.xml new file mode 100644 index 0000000..90581a6 --- /dev/null +++ b/src/it/latest-java-class-support/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + jacoco + latest-java-class-support + 1.0-SNAPSHOT + + + 25 + + + + + junit + junit + 4.13.2 + test + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.14 + + + + prepare-agent + + + + + + io.github.surpsg + diff-coverage-maven-plugin + + + diffFile.patch + + + + + + diffCoverage + + + + + + + diff --git a/src/it/latest-java-class-support/src/main/java/com/test/Example.java b/src/it/latest-java-class-support/src/main/java/com/test/Example.java new file mode 100644 index 0000000..439c90a --- /dev/null +++ b/src/it/latest-java-class-support/src/main/java/com/test/Example.java @@ -0,0 +1,14 @@ +package com.test; + +public class Example { + + public void sayHello(boolean a) { + if (a) { + System.out.println("if"); + } else { + System.out.println("else"); + } + System.out.println("return"); + } + +} diff --git a/src/it/latest-java-class-support/src/test/java/com/test/ExampleTest.java b/src/it/latest-java-class-support/src/test/java/com/test/ExampleTest.java new file mode 100644 index 0000000..d64cc3c --- /dev/null +++ b/src/it/latest-java-class-support/src/test/java/com/test/ExampleTest.java @@ -0,0 +1,11 @@ +package com.test; +import org.junit.Test; + +public class ExampleTest { + + @Test + public void test() { + new Example().sayHello(true); + } + +} diff --git a/src/it/latest-java-class-support/verify.bsh b/src/it/latest-java-class-support/verify.bsh new file mode 100644 index 0000000..459a77e --- /dev/null +++ b/src/it/latest-java-class-support/verify.bsh @@ -0,0 +1,13 @@ +import java.io.*; +import org.codehaus.plexus.util.*; + +File reportsDir = new File(basedir, "target/site/delta-coverage/aggregated"); +File htmlReportDir = new File( reportsDir, "/html" ); +if ( !htmlReportDir.exists() || !htmlReportDir.isDirectory() ) { + throw new RuntimeException( "Html report dir wasn't found: " + htmlReportDir.getAbsolutePath() ); +} + +File xmlReportFile = new File( reportsDir, "report.xml" ); +if ( !xmlReportFile.exists() || !xmlReportFile.isFile() ) { + throw new RuntimeException( "Xml report file wasn't found: " + xmlReportFile.getAbsolutePath() ); +} From 7d48cf11aeb759611236415c5b1ef51c3bb43c7b Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:11:57 +0200 Subject: [PATCH 2/7] release 1.1.0 --- .github/workflows/build.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06b9005..7cf2efe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,41 +1,35 @@ -# This is a basic workflow to help you get started with Actions +name: 🔨 CI -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: push: branches: [main] pull_request: + branches: + - '**' -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v6 + - name: 📥 Checkout + uses: actions/checkout@v6 with: fetch-depth: 0 - - - name: Set up JDK + + - name: ☕ Set up JDK uses: actions/setup-java@v5 with: distribution: temurin java-version: 17 cache: maven - - name: Build with Maven + - name: 🔨 Build with Maven run: ./mvnw clean install --file pom.xml -Ddiff.source="refs/remotes/origin/$GITHUB_BASE_REF" -e - - name: Expose Integration tests build logs - uses: actions/upload-artifact@master + - name: 📦 Expose Integration Tests Build Logs if: always() + uses: actions/upload-artifact@master with: name: int-tests-artifacts path: | From 8461496002eb74a6c306107cd1abe25d7676fe0c Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:13:37 +0200 Subject: [PATCH 3/7] release 1.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 140bd6f..a0790b4 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 0.8.14 3.6.0 - 1.1.0 + 1.0.0 From dea896b603fdc2a3a2117ab1710daeb3c588141d Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:19:44 +0200 Subject: [PATCH 4/7] release 1.1.0 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cf2efe..64ef1da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-java@v5 with: distribution: temurin - java-version: 17 + java-version: 25 cache: maven - name: 🔨 Build with Maven From d8cdf169cab8fd5409823b5ffa316218bf2617d3 Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:51:37 +0200 Subject: [PATCH 5/7] release 1.1.0 --- .github/workflows/build.yml | 12 ++++++- .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++---- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64ef1da..d7dbec9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,10 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + issues: read + pull-requests: write + checks: write steps: - name: 📥 Checkout @@ -27,8 +31,14 @@ jobs: - name: 🔨 Build with Maven run: ./mvnw clean install --file pom.xml -Ddiff.source="refs/remotes/origin/$GITHUB_BASE_REF" -e + - name: 📈 Publish Delta Coverage Report + if: ${{ github.event_name == 'pull_request' }} + uses: gw-kit/delta-coverage-action@v1 + with: + summary-report-base-path: target/site/coverage-reports/ + - name: 📦 Expose Integration Tests Build Logs - if: always() + if: ${{ always() }} uses: actions/upload-artifact@master with: name: int-tests-artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de12e63..ac492be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,18 @@ name: 🚀 Release +run-name: 🚀 Release from ${{ github.ref_name }} on: - release: - types: [prereleased, released] + workflow_dispatch: jobs: release: + if: startsWith(github.ref_name, 'release/') runs-on: ubuntu-latest + permissions: + contents: write + environment: + name: maven-central + url: ${{ steps.gh-release.outputs.url }} steps: - name: 📥 Checkout @@ -17,9 +23,55 @@ jobs: - name: ☕ Set up JDK uses: actions/setup-java@v5 with: - distribution: 'adopt' - java-version: '11' - cache: 'maven' + distribution: temurin + java-version: 25 + cache: maven + server-id: central + server-username: CENTRAL_USERNAME + server-password: CENTRAL_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: 🏷️ Extract Version + id: version + run: | + VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + + - name: 📦 Publish to Maven Central + env: + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: ./mvnw clean deploy -Prelease -e + + - name: 🏷️ Create GitHub Release + id: gh-release + uses: actions/github-script@v7 + with: + script: | + const version = 'v${{ steps.version.outputs.version }}'; + const { data: release } = await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: version, + name: version, + generate_release_notes: true, + target_commitish: context.sha, + }); + core.setOutput('url', release.html_url); + core.note(`Created release ${release.html_url}`); - - name: 🔨 Build with Maven - run: mvn install --file pom.xml -e + - name: 🔀 Merge to master + uses: actions/github-script@v7 + with: + script: | + const branch = context.ref.replace('refs/heads/', ''); + const { data: commit } = await github.rest.repos.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + base: 'master', + head: branch, + commit_message: `Merge ${branch}`, + }); + core.info(`Merged ${branch} to master: ${commit.sha}`); From c1c947f560ab45f0f76b05ec9f97c6c29bb2d60b Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 00:59:59 +0200 Subject: [PATCH 6/7] release 1.1.0 --- src/it/latest-java-class-support/diffFile.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/it/latest-java-class-support/diffFile.patch diff --git a/src/it/latest-java-class-support/diffFile.patch b/src/it/latest-java-class-support/diffFile.patch new file mode 100644 index 0000000..1119d91 --- /dev/null +++ b/src/it/latest-java-class-support/diffFile.patch @@ -0,0 +1,14 @@ +=================================================================== +--- a/src/main/java/com/test/Example.java (revision 9e78667391946d3461759f5589b67d3a676d8ce7) ++++ b/src/main/java/com/test/Example.java (date 1593433398791) +@@ -5,7 +5,10 @@ + public void sayHello(boolean a) { + if (a) { + System.out.println("if"); ++ } else { ++ System.out.println("else"); + } ++ System.out.println("return"); + } + + } From 6aaaa65592f3a9a479c769e9a1b8f379736de789 Mon Sep 17 00:00:00 2001 From: Sergii Gnatiuk Date: Sun, 22 Feb 2026 01:04:25 +0200 Subject: [PATCH 7/7] release 1.1.0 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7dbec9..70bd4eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} uses: gw-kit/delta-coverage-action@v1 with: - summary-report-base-path: target/site/coverage-reports/ + summary-report-base-path: target/site/ - name: 📦 Expose Integration Tests Build Logs if: ${{ always() }}