Skip to content

Commit 36181ec

Browse files
horghclaude
andcommitted
Run checkstyle as separate CI job on Linux with latest Java
Move checkstyle out of the test phase and into a dedicated CI job. This allows dependabot to update the checkstyle version and speeds up test runs on Windows/macOS by not running checkstyle there. Checkstyle 13+ requires Java 21+, so we run it on Java 24 on Linux. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fc72150 commit 36181ec

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
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: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@
127127
</execution>
128128
</executions>
129129
</plugin>
130+
<!-- Checkstyle 13+ requires Java 21+. Run manually or via CI. -->
131+
<plugin>
132+
<groupId>org.apache.maven.plugins</groupId>
133+
<artifactId>maven-checkstyle-plugin</artifactId>
134+
<version>3.6.0</version>
135+
<configuration>
136+
<consoleOutput>true</consoleOutput>
137+
<configLocation>checkstyle.xml</configLocation>
138+
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
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>
130149
<plugin>
131150
<artifactId>maven-javadoc-plugin</artifactId>
132151
<version>3.12.0</version>
@@ -340,43 +359,5 @@
340359
</plugins>
341360
</build>
342361
</profile>
343-
<!-- Checkstyle 13+ requires Java 21+. -->
344-
<profile>
345-
<id>checkstyle-jdk21</id>
346-
<activation>
347-
<jdk>[21,)</jdk>
348-
</activation>
349-
<build>
350-
<plugins>
351-
<plugin>
352-
<groupId>org.apache.maven.plugins</groupId>
353-
<artifactId>maven-checkstyle-plugin</artifactId>
354-
<version>3.6.0</version>
355-
<configuration>
356-
<consoleOutput>true</consoleOutput>
357-
<configLocation>checkstyle.xml</configLocation>
358-
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
359-
<violationSeverity>warning</violationSeverity>
360-
</configuration>
361-
<dependencies>
362-
<dependency>
363-
<groupId>com.puppycrawl.tools</groupId>
364-
<artifactId>checkstyle</artifactId>
365-
<version>13.0.0</version>
366-
</dependency>
367-
</dependencies>
368-
<executions>
369-
<execution>
370-
<id>checkstyle</id>
371-
<phase>test</phase>
372-
<goals>
373-
<goal>check</goal>
374-
</goals>
375-
</execution>
376-
</executions>
377-
</plugin>
378-
</plugins>
379-
</build>
380-
</profile>
381362
</profiles>
382363
</project>

0 commit comments

Comments
 (0)