File tree 5 files changed +87
-4
lines changed
5 files changed +87
-4
lines changed Original file line number Diff line number Diff line change 7
7
runs-on : ubuntu-latest
8
8
9
9
steps :
10
- - uses : actions/checkout@v2
10
+ - uses : actions/checkout@v3
11
11
- name : Set up JDK 11
12
- uses : actions/setup-java@v2
12
+ uses : actions/setup-java@v3
13
13
with :
14
14
distribution : ' temurin'
15
15
java-version : ' 11'
Original file line number Diff line number Diff line change
1
+ name : Check API compatibility
2
+
3
+ on : pull_request
4
+
5
+ jobs :
6
+ check-api-compatibility :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - name : Checkout old version
11
+ uses : actions/checkout@v3
12
+ with :
13
+ ref : ${{ github.event.pull_request.base.sha }}
14
+ path : ' gson-old-japicmp'
15
+
16
+ - name : Checkout new version
17
+ uses : actions/checkout@v3
18
+
19
+ - name : Set up JDK 11
20
+ uses : actions/setup-java@v3
21
+ with :
22
+ distribution : ' temurin'
23
+ java-version : ' 11'
24
+ cache : ' maven'
25
+
26
+ - name : Build old version
27
+ run : |
28
+ cd gson-old-japicmp
29
+ # Set dummy version
30
+ mvn --batch-mode org.codehaus.mojo:versions-maven-plugin:2.11.0:set -DnewVersion=JAPICMP-OLD
31
+ # Install artifacts with dummy version in local repository; used later by Maven plugin for comparison
32
+ mvn --batch-mode install -DskipTests
33
+
34
+ - name : Check API compatibility
35
+ run : |
36
+ mvn --batch-mode --fail-at-end package japicmp:cmp -DskipTests
37
+
38
+ - name : Upload API differences artifacts
39
+ uses : actions/upload-artifact@v3
40
+ with :
41
+ name : api-differences
42
+ path : |
43
+ **/target/japicmp/default-cli.html
44
+ **/target/japicmp/default-cli.diff
Original file line number Diff line number Diff line change 25
25
26
26
steps :
27
27
- name : Checkout repository
28
- uses : actions/checkout@v2
28
+ uses : actions/checkout@v3
29
29
30
30
# Initializes the CodeQL tools for scanning
31
31
- name : Initialize CodeQL
Original file line number Diff line number Diff line change 44
44
<build >
45
45
<pluginManagement >
46
46
<plugins >
47
+ <plugin >
48
+ <groupId >com.github.siom79.japicmp</groupId >
49
+ <artifactId >japicmp-maven-plugin</artifactId >
50
+ <version >0.15.7</version >
51
+ <configuration >
52
+ <!-- This module is not supposed to be consumed as library, so no need to check API -->
53
+ <skip >true</skip >
54
+ </configuration >
55
+ </plugin >
47
56
<plugin >
48
57
<groupId >org.apache.maven.plugins</groupId >
49
58
<artifactId >maven-deploy-plugin</artifactId >
Original file line number Diff line number Diff line change 20
20
21
21
<modules >
22
22
<module >gson</module >
23
- <module >extras</module >
23
+ <module >extras</module >
24
24
<module >metrics</module >
25
25
<module >proto</module >
26
26
</modules >
103
103
<artifactId >maven-jar-plugin</artifactId >
104
104
<version >3.2.2</version >
105
105
</plugin >
106
+ <!-- Plugin for checking source and binary compatibility; used by GitHub workflow -->
107
+ <plugin >
108
+ <groupId >com.github.siom79.japicmp</groupId >
109
+ <artifactId >japicmp-maven-plugin</artifactId >
110
+ <version >0.15.7</version >
111
+ <configuration >
112
+ <oldVersion >
113
+ <dependency >
114
+ <groupId >${project.groupId} </groupId >
115
+ <artifactId >${project.artifactId}</artifactId >
116
+ <!-- This is set by the GitHub workflow -->
117
+ <version >JAPICMP-OLD</version >
118
+ </dependency >
119
+ </oldVersion >
120
+ <newVersion >
121
+ <file >
122
+ <path >${project.build.directory} /${project.build.finalName} .${project.packaging} </path >
123
+ </file >
124
+ </newVersion >
125
+ <parameter >
126
+ <breakBuildOnSourceIncompatibleModifications >true</breakBuildOnSourceIncompatibleModifications >
127
+ <breakBuildOnBinaryIncompatibleModifications >true</breakBuildOnBinaryIncompatibleModifications >
128
+ <excludes >
129
+ <exclude >com.google.gson.internal</exclude >
130
+ </excludes >
131
+ <onlyModified >true</onlyModified >
132
+ <skipXmlReport >true</skipXmlReport >
133
+ </parameter >
134
+ </configuration >
135
+ </plugin >
106
136
</plugins >
107
137
</pluginManagement >
108
138
<plugins >
You can’t perform that action at this time.
0 commit comments