Skip to content

Commit 0248f49

Browse files
authored
Merge pull request #584 from maxmind/wstorey/checkstyle-separate-job
Run checkstyle as separate CI job on Linux with latest Java
2 parents 10dcaf1 + 13fe653 commit 0248f49

File tree

2 files changed

+35
-57
lines changed

2 files changed

+35
-57
lines changed

.github/workflows/checkstyle.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Run checkstyle
2+
# Checkstyle 13+ requires Java 21+.
3+
on: [push, pull_request]
4+
permissions: {}
5+
jobs:
6+
checkstyle:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
10+
with:
11+
submodules: true
12+
persist-credentials: false
13+
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
14+
with:
15+
distribution: zulu
16+
java-version: 24
17+
- run: mvn checkstyle:check -B

pom.xml

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@
128128
</execution>
129129
</executions>
130130
</plugin>
131+
<!-- Checkstyle 13+ requires Java 21+. Run manually or via CI. -->
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-checkstyle-plugin</artifactId>
135+
<version>3.6.0</version>
136+
<configuration>
137+
<consoleOutput>true</consoleOutput>
138+
<configLocation>checkstyle.xml</configLocation>
139+
<violationSeverity>warning</violationSeverity>
140+
</configuration>
141+
<dependencies>
142+
<dependency>
143+
<groupId>com.puppycrawl.tools</groupId>
144+
<artifactId>checkstyle</artifactId>
145+
<version>13.0.0</version>
146+
</dependency>
147+
</dependencies>
148+
</plugin>
131149
<plugin>
132150
<groupId>org.apache.maven.plugins</groupId>
133151
<artifactId>maven-site-plugin</artifactId>
@@ -255,26 +273,6 @@
255273
<japicmp.baselineVersion>4.0.0</japicmp.baselineVersion>
256274
</properties>
257275

258-
<reporting>
259-
<plugins>
260-
<plugin>
261-
<groupId>org.apache.maven.plugins</groupId>
262-
<artifactId>maven-checkstyle-plugin</artifactId>
263-
<version>3.6.0</version>
264-
<reportSets>
265-
<reportSet>
266-
<reports>
267-
<report>checkstyle</report>
268-
</reports>
269-
<configuration>
270-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
271-
</configuration>
272-
</reportSet>
273-
</reportSets>
274-
</plugin>
275-
</plugins>
276-
</reporting>
277-
278276
<distributionManagement>
279277
<repository>
280278
<id>sonatype-nexus-staging</id>
@@ -344,42 +342,5 @@
344342
</plugins>
345343
</build>
346344
</profile>
347-
<!-- Checkstyle 13+ requires Java 21+. -->
348-
<profile>
349-
<id>checkstyle-jdk21</id>
350-
<activation>
351-
<jdk>[21,)</jdk>
352-
</activation>
353-
<build>
354-
<plugins>
355-
<plugin>
356-
<groupId>org.apache.maven.plugins</groupId>
357-
<artifactId>maven-checkstyle-plugin</artifactId>
358-
<version>3.6.0</version>
359-
<configuration>
360-
<consoleOutput>true</consoleOutput>
361-
<configLocation>checkstyle.xml</configLocation>
362-
<violationSeverity>warning</violationSeverity>
363-
</configuration>
364-
<dependencies>
365-
<dependency>
366-
<groupId>com.puppycrawl.tools</groupId>
367-
<artifactId>checkstyle</artifactId>
368-
<version>13.0.0</version>
369-
</dependency>
370-
</dependencies>
371-
<executions>
372-
<execution>
373-
<id>checkstyle</id>
374-
<phase>test</phase>
375-
<goals>
376-
<goal>check</goal>
377-
</goals>
378-
</execution>
379-
</executions>
380-
</plugin>
381-
</plugins>
382-
</build>
383-
</profile>
384345
</profiles>
385346
</project>

0 commit comments

Comments
 (0)