From cd5a22802a0de330de00ce7e4a65fd80cd5e7a53 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Mon, 25 Mar 2024 17:01:07 +0100 Subject: [PATCH 1/2] pom: Check API changes against SemVer rules during build Use japicmp to detect any changes in the public API compared to the previous release, and fail the build if the rules of semantic versioning are violated. This is run during the "verify" phase, just before the "install" phase. It also outputs the API differences in the target/japicmp folder. --- pom.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pom.xml b/pom.xml index a26bcb3..8975d27 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,7 @@ 1.5 2.5.2 0.8.10 + 0.20.0 3.4.0 3.2.1 3.3.0 @@ -393,6 +394,11 @@ jacoco-maven-plugin ${version.jacoco.plugin} + + com.github.siom79.japicmp + japicmp-maven-plugin + ${version.japicmp.plugin} + org.sonatype.plugins nexus-staging-maven-plugin @@ -457,6 +463,28 @@ + + + com.github.siom79.japicmp + japicmp-maven-plugin + + + + + true + + true + + + + + verify + + cmp + + + + From 153a415e1efef01453be65336979cb8e2beff261 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Mon, 25 Mar 2024 17:11:20 +0100 Subject: [PATCH 2/2] workflows: Add workflow to build and run tests on every push and PR --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9f960de --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: Build and run unit tests +on: + push: + pull_request: + + # Allows to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'adopt' + - name: Build and run unit tests + run: mvn --batch-mode clean install