Skip to content

Commit c662249

Browse files
committed
Add Google Java Style format check to build and CI
1 parent 40be08c commit c662249

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,30 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
name: Format Check
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v5
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
cache: maven
22+
23+
- name: Check formatting (Google Java Style)
24+
run: mvn --batch-mode fmt:check
25+
1026
test:
1127
runs-on: ubuntu-latest
1228
strategy:
1329
fail-fast: false
1430
matrix:
1531
java-version: [11, 17, 21]
1632

17-
name: JDK ${{ matrix.java-version }}
33+
name: Test JDK ${{ matrix.java-version }}
1834

1935
steps:
2036
- uses: actions/checkout@v6

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,18 @@
422422
</executions>
423423
</plugin>
424424

425+
<plugin>
426+
<groupId>com.spotify.fmt</groupId>
427+
<artifactId>fmt-maven-plugin</artifactId>
428+
<executions>
429+
<execution>
430+
<goals>
431+
<goal>check</goal>
432+
</goals>
433+
</execution>
434+
</executions>
435+
</plugin>
436+
425437
</plugins>
426438

427439
<defaultGoal>install</defaultGoal>

0 commit comments

Comments
 (0)