From f979638988a5f13e8cb57084cca8e1b942ef41f3 Mon Sep 17 00:00:00 2001 From: cobalt-github-releaser-bot <95661244+cobalt-github-releaser-bot@users.noreply.github.com> Date: Fri, 24 May 2024 14:43:33 -0700 Subject: [PATCH] Cherry pick PR #3348: Switch to caching Gradle wrapper and components (#3353) Refer to the original PR: https://github.com/youtube/cobalt/pull/3348 Adds a cache for Gradle components. Cache will be saved on successful build and keyed off Android gradle build files. b/337337924 --------- Co-authored-by: Kaido Kert --- .github/workflows/main.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a06e842efdb7..d5e1c15b2bac 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -239,12 +239,14 @@ jobs: # Use fetch depth of 0 to get full history for a valid build id. fetch-depth: 0 persist-credentials: false - - name: Setup Gradle + - name: Cache Gradle + uses: actions/cache@v3 if: startsWith( matrix.target_platform , 'android') - run: | - for i in `seq 1 5`; do - starboard/android/apk/gradlew --version || true - done + with: + key: gradle-cache-${{ hashFiles('starboard/android/apk/**/*gradle*') }} + path: | + /root/.gradle/caches + /root/.gradle/wrapper - name: GN uses: ./.github/actions/gn - name: Build Cobalt