Skip to content

Commit 7cd5ff4

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 2cc0f3e commit 7cd5ff4

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/api-compat.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
submodules: true
13+
persist-credentials: false
14+
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
15+
with:
16+
distribution: zulu
17+
java-version: 17
18+
cache: maven
19+
- name: Check API Compatibility
20+
run: mvn verify -P api-compat -DskipTests -Dgpg.skip=true

pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,46 @@
304304
</plugins>
305305
</build>
306306
</profile>
307+
<profile>
308+
<id>api-compat</id>
309+
<build>
310+
<plugins>
311+
<plugin>
312+
<groupId>com.github.siom79.japicmp</groupId>
313+
<artifactId>japicmp-maven-plugin</artifactId>
314+
<version>0.25.1</version>
315+
<configuration>
316+
<oldVersion>
317+
<dependency>
318+
<groupId>${project.groupId}</groupId>
319+
<artifactId>${project.artifactId}</artifactId>
320+
<version>RELEASE</version>
321+
<type>jar</type>
322+
</dependency>
323+
</oldVersion>
324+
<newVersion>
325+
<file>
326+
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
327+
</file>
328+
</newVersion>
329+
<parameter>
330+
<accessModifier>public</accessModifier>
331+
<breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
332+
<onlyBinaryIncompatible>false</onlyBinaryIncompatible>
333+
<onlyModified>true</onlyModified>
334+
</parameter>
335+
</configuration>
336+
<executions>
337+
<execution>
338+
<phase>verify</phase>
339+
<goals>
340+
<goal>cmp</goal>
341+
</goals>
342+
</execution>
343+
</executions>
344+
</plugin>
345+
</plugins>
346+
</build>
347+
</profile>
307348
</profiles>
308349
</project>

0 commit comments

Comments
 (0)