From 52d3e4c710e71fcd1b800e4f9da8872204684686 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 29 Jan 2024 15:40:34 +0100 Subject: [PATCH 1/2] chore(ci): use setup-gradle to handle cache --- .github/actions/setup/action.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 27f41aa6fc..11c617afed 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -25,12 +25,15 @@ 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 + - name: Download Java formatter if: inputs.type != 'minimal' shell: bash @@ -152,10 +155,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 From ca75b303090cfa57f792028e8fb05f3d0ec987d1 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 29 Jan 2024 15:54:45 +0100 Subject: [PATCH 2/2] no cache for node-modules --- .github/actions/setup/action.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 11c617afed..ea18b3deeb 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -33,6 +33,8 @@ runs: - 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' @@ -58,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