Skip to content

Commit

Permalink
chore(ci): use setup-gradle to handle cache (#2628)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Jan 29, 2024
1 parent 2400c35 commit a943db6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ runs:
with:
distribution: zulu
java-version-file: config/.java-version
cache: gradle

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

- name: Setup gradle
if: inputs.type != 'minimal'
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false

- name: Download Java formatter
if: inputs.type != 'minimal'
shell: bash
Expand All @@ -55,12 +60,6 @@ runs:
# let yarn handle the cache hash
key: yarn-cache-${{ env.CACHE_VERSION }}

- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ env.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}

- name: Install JavaScript dependencies
shell: bash
run: YARN_ENABLE_HARDENED_MODE=0 yarn install
Expand Down Expand Up @@ -152,10 +151,8 @@ runs:
if: ${{ inputs.language == 'kotlin' }}
uses: actions/cache@v4
with:
path: |
clients/algoliasearch-client-kotlin/.gradle
clients/algoliasearch-client-kotlin/client/build/spotless
key: gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('clients/algoliasearch-client-kotlin/build.gradle.kts') }}
path: clients/algoliasearch-client-kotlin/client/build/spotless
key: spotless-${{ env.CACHE_VERSION }}-${{ hashFiles('clients/algoliasearch-client-kotlin/build.gradle.kts') }}

# Dart
- name: Install dart
Expand Down

0 comments on commit a943db6

Please sign in to comment.