Skip to content

Commit a943db6

Browse files
authored
chore(ci): use setup-gradle to handle cache (#2628)
1 parent 2400c35 commit a943db6

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

.github/actions/setup/action.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ runs:
2525
with:
2626
distribution: zulu
2727
java-version-file: config/.java-version
28-
cache: gradle
2928

3029
- name: Validate gradle wrapper
3130
if: inputs.type != 'minimal'
3231
uses: gradle/wrapper-validation-action@v1
3332

33+
- name: Setup gradle
34+
if: inputs.type != 'minimal'
35+
uses: gradle/actions/setup-gradle@v3
36+
with:
37+
cache-read-only: false
38+
3439
- name: Download Java formatter
3540
if: inputs.type != 'minimal'
3641
shell: bash
@@ -55,12 +60,6 @@ runs:
5560
# let yarn handle the cache hash
5661
key: yarn-cache-${{ env.CACHE_VERSION }}
5762

58-
- name: Cache node modules
59-
uses: actions/cache@v4
60-
with:
61-
path: node_modules
62-
key: node-modules-${{ env.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
63-
6463
- name: Install JavaScript dependencies
6564
shell: bash
6665
run: YARN_ENABLE_HARDENED_MODE=0 yarn install
@@ -152,10 +151,8 @@ runs:
152151
if: ${{ inputs.language == 'kotlin' }}
153152
uses: actions/cache@v4
154153
with:
155-
path: |
156-
clients/algoliasearch-client-kotlin/.gradle
157-
clients/algoliasearch-client-kotlin/client/build/spotless
158-
key: gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('clients/algoliasearch-client-kotlin/build.gradle.kts') }}
154+
path: clients/algoliasearch-client-kotlin/client/build/spotless
155+
key: spotless-${{ env.CACHE_VERSION }}-${{ hashFiles('clients/algoliasearch-client-kotlin/build.gradle.kts') }}
159156

160157
# Dart
161158
- name: Install dart

0 commit comments

Comments
 (0)