diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c00526ab..3b67c832b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: distribution: 'zulu' java-version: '17' - name: 'Cache Bazel files' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/bazel key: ${{ runner.os }}-${{ env.cache-version }}-bazel-build-${{ github.sha }} @@ -75,7 +75,7 @@ jobs: distribution: 'zulu' java-version: '17' - name: 'Cache Bazel files' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/bazel key: ${{ runner.os }}-${{ env.cache-version }}-bazel-test-${{ github.sha }} @@ -110,9 +110,21 @@ jobs: run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm + sudo udevadm trigger --name-match=kvm + - name: Set ANDROID_USER_HOME + run: echo "ANDROID_USER_HOME=$HOME/.android" >> $GITHUB_ENV - name: 'Cache Gradle files' uses: gradle/gradle-build-action@v2 + shell: bash + - name: 'Cache GMD snapshot' + uses: actions/cache@v4 + with: + path: | + ${{ env.ANDROID_USER_HOME }}/avd/gradle-managed/* + ${{ env.ANDROID_USER_HOME }}/adb* + # Saving the snapshot to cache is expensive + # Use the hash of the snapshot files to only save snapshot if content has changed + key: ${{ runner.os }}-${{ env.cache-version }}-gmd-${{ hashFiles('${{ env.ANDROID_USER_HOME }}/avd/gradle-managed') }} - name: 'Download local snapshot for tests' uses: actions/download-artifact@v4 with: @@ -137,4 +149,3 @@ jobs: name: test-reports path: gradle-tests/**/build/reports/androidTests/ -