@@ -38,38 +38,17 @@ jobs:
3838 sudo udevadm trigger --name-match=kvm
3939 ls /dev/kvm
4040
41- # Check caches first
42- - name : Cache APK build output
43- id : cache-apk
44- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
45- with :
46- path : example/android/app/build/outputs/apk/debug/app-debug.apk
47- key : ${{ runner.os }}-apk-${{ hashFiles('android/**/*.{java,kt,xml,gradle}', 'example/android/**/*.{java,kt,xml,gradle}', 'package.json', 'yarn.lock', '.github/workflows/android.yml') }}
48-
49- - name : AVD cache
50- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
51- id : avd-cache
52- with :
53- path : |
54- ~/.android/avd/*
55- ~/.android/adb*
56- key : avd-${{ env.DEVICE_API_LEVEL }}-${{ env.DEVICE_ARCH }}
57-
5841 # Build dependencies (only if APK not cached)
5942 - name : Cache NDK
60- id : cache-ndk
61- if : steps.cache-apk.outputs.cache-hit != 'true'
6243 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
6344 with :
6445 path : /usr/local/lib/android/sdk/ndk/27.3.13750724
6546 key : ${{ runner.os }}-ndk-27.3.13750724
6647
6748 - name : Install NDK
68- if : steps.cache-apk.outputs.cache-hit != 'true' && steps.cache-ndk.outputs.cache-hit != 'true'
6949 run : echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.3.13750724"
7050
7151 - name : Cache Gradle
72- if : steps.cache-apk.outputs.cache-hit != 'true'
7352 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
7453 with :
7554 path : |
@@ -78,19 +57,25 @@ jobs:
7857 example/android/.gradle
7958 example/android/app/.cxx
8059 example/android/app/build/intermediates
81- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'android/build.gradle', 'example/android/app/build.gradle', '.github/workflows/android.yml' ) }}
60+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'android/build.gradle', 'example/android/app/build.gradle') }}
8261 restore-keys : |
8362 ${{ runner.os }}-gradle-
8463
8564 # Build APK (only if not cached)
8665 - name : Build APK with Gradle
87- if : steps.cache-apk.outputs.cache-hit != 'true'
8866 working-directory : example
8967 run : yarn app:package:android
9068
69+ - name : AVD cache
70+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
71+ with :
72+ path : |
73+ ~/.android/avd/*
74+ ~/.android/adb*
75+ key : avd-${{ env.DEVICE_API_LEVEL }}-${{ env.DEVICE_ARCH }}
76+
9177 # Create AVD (only if not cached, runs after build)
9278 - name : Create AVD and generate snapshot for caching
93- if : steps.avd-cache.outputs.cache-hit != 'true'
9479 uses : reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b
9580 with :
9681 api-level : ${{ env.DEVICE_API_LEVEL }}
0 commit comments