Skip to content

Commit 9241de4

Browse files
committed
ICU-23091 Update workflow to initialize plugin deps before job
1 parent 1b3a489 commit 9241de4

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

.github/workflows/icu4j.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,6 @@ permissions:
3939

4040
jobs:
4141

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-
5742
# Initialize the Maven artifact cache
5843
#
5944
# This job is created according to the cache strategy of reuse from a single job:
@@ -79,6 +64,31 @@ jobs:
7964
cd icu4j;
8065
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
8166
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+
8292
# ICU4J build and unit test using Maven
8393
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
8494
icu4j-mvn-build-and-test:

0 commit comments

Comments
 (0)