File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Spotless Check
2
+
3
+ on : [pull_request]
4
+
5
+ jobs :
6
+ spotless :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - name : Harden Runner
11
+ uses : step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
12
+ with :
13
+ egress-policy : audit
14
+
15
+ - name : Checkout code
16
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
17
+
18
+ - name : Set up JDK 21
19
+ uses : actions/setup-java@d62f12622c1c8c47f24e7d3b71611062a1e56a13 # v3.13.0
20
+ with :
21
+ distribution : ' temurin'
22
+ java-version : ' 21'
23
+
24
+ - name : Cache Gradle packages
25
+ uses : actions/cache@b6e12325fcdfbd3b3d3e192ae02d9bcd3c9b37c5 # v2.1.8
26
+ with :
27
+ path : |
28
+ ~/.gradle/caches
29
+ ~/.gradle/wrapper
30
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-gradle-
33
+
34
+ - name : Run Spotless Check
35
+ run : ./gradlew spotlessCheck
36
+
37
+ - name : Run Spotless Apply and Check for Changes
38
+ id : check_spotless
39
+ run : |
40
+ ./gradlew spotlessApply
41
+ if ! git diff --exit-code; then
42
+ echo "Spotless found formatting issues. Please run './gradlew spotlessApply' to fix them."
43
+ exit 1
44
+ fi
You can’t perform that action at this time.
0 commit comments