Skip to content

Commit

Permalink
Experiment with using hash in the snapshot key
Browse files Browse the repository at this point in the history
  • Loading branch information
brettchabot committed Jan 25, 2024
1 parent 36b7f78 commit eb0f902
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand All @@ -137,4 +149,3 @@ jobs:
name: test-reports
path: gradle-tests/**/build/reports/androidTests/


0 comments on commit eb0f902

Please sign in to comment.