@@ -39,21 +39,6 @@ permissions:
39
39
40
40
jobs :
41
41
42
- # Using the Java style formatter google-java-style provided by the Spotless
43
- # plugin configured in the root pom.xml using 4-space indents (AOSP style).
44
- # Spotless is configured to run only on files in this branch (PR) that differ
45
- # from origin/main
46
- formatter :
47
- name : Formatter + Style checker
48
- runs-on : ubuntu-latest
49
- steps :
50
- - name : Checkout and setup
51
- uses : actions/checkout@v4
52
- with :
53
- fetch-depth : 0 # fetch all branches so that Spotless can resolve `origin/main`
54
- - name : Check Java style
55
- run : mvn spotless:check || (echo "Style checker failed. Formatting changes can be applied by 'mvn spotless:apply'" && exit 1)
56
-
57
42
# Initialize the Maven artifact cache
58
43
#
59
44
# This job is created according to the cache strategy of reuse from a single job:
79
64
cd icu4j;
80
65
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
81
66
67
+ # Using the Java style formatter google-java-style provided by the Spotless
68
+ # plugin configured in the root pom.xml using 4-space indents (AOSP style).
69
+ # Spotless is configured to run only on files in this branch (PR) that differ
70
+ # from origin/main
71
+ formatter :
72
+ name : Formatter + Style checker
73
+ needs : icu4j-mvn-init-cache
74
+ runs-on : ubuntu-latest
75
+ steps :
76
+ - name : Checkout and setup
77
+ uses : actions/checkout@v4
78
+ with :
79
+ fetch-depth : 0 # fetch all branches so that Spotless can resolve `origin/main`
80
+ - name : Restore read-only cache of local Maven repository
81
+ uses : actions/cache/restore@v4
82
+ id : cache
83
+ with :
84
+ path : ~/.m2/repository
85
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
86
+ restore-keys : |
87
+ ${{ runner.os }}-maven-
88
+ lookup-only : true
89
+ - name : Check Java style
90
+ run : mvn spotless:check || (echo "Style checker failed. Formatting changes can be applied by 'mvn spotless:apply'" && exit 1)
91
+
82
92
# ICU4J build and unit test using Maven
83
93
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
84
94
icu4j-mvn-build-and-test :
0 commit comments