Skip to content

Commit a449be1

Browse files
oschwaldclaude
andcommitted
Add API compatibility checking with japicmp
This adds a GitHub Actions workflow that runs on PRs to detect breaking changes in the public API. The check uses japicmp with semantic versioning support, so it will only fail if breaking changes are detected without a major version bump. ENG-3367 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b51f304 commit a449be1

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/api-compat.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: API Compatibility Check
2+
on:
3+
pull_request:
4+
permissions:
5+
contents: read
6+
jobs:
7+
api-compat:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
11+
with:
12+
persist-credentials: false
13+
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
14+
with:
15+
distribution: zulu
16+
java-version: 17
17+
cache: maven
18+
- name: Check API Compatibility
19+
run: mvn verify -P api-compat -DskipTests

pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,47 @@
305305
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
306306
</repository>
307307
</distributionManagement>
308+
309+
<profiles>
310+
<profile>
311+
<id>api-compat</id>
312+
<build>
313+
<plugins>
314+
<plugin>
315+
<groupId>com.github.siom79.japicmp</groupId>
316+
<artifactId>japicmp-maven-plugin</artifactId>
317+
<version>0.25.1</version>
318+
<configuration>
319+
<oldVersion>
320+
<dependency>
321+
<groupId>${project.groupId}</groupId>
322+
<artifactId>${project.artifactId}</artifactId>
323+
<version>RELEASE</version>
324+
<type>jar</type>
325+
</dependency>
326+
</oldVersion>
327+
<newVersion>
328+
<file>
329+
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
330+
</file>
331+
</newVersion>
332+
<parameter>
333+
<accessModifier>public</accessModifier>
334+
<breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
335+
<onlyBinaryIncompatible>false</onlyBinaryIncompatible>
336+
</parameter>
337+
</configuration>
338+
<executions>
339+
<execution>
340+
<phase>verify</phase>
341+
<goals>
342+
<goal>cmp</goal>
343+
</goals>
344+
</execution>
345+
</executions>
346+
</plugin>
347+
</plugins>
348+
</build>
349+
</profile>
350+
</profiles>
308351
</project>

0 commit comments

Comments
 (0)