File tree Expand file tree Collapse file tree
packages/github-action/src/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ inputs:
2222 required : false
2323 type : string
2424 default : ' '
25+ cacheAvd :
26+ description : Whether to cache the AVD
27+ required : false
28+ type : boolean
29+ default : ' true'
2530runs :
2631 using : ' composite'
2732 steps :
6873 sudo udevadm trigger --name-match=kvm
6974 ls /dev/kvm
7075 - name : Compute AVD cache key
76+ if : ${{ fromJSON(inputs.cacheAvd) }}
7177 id : avd-key
7278 shell : bash
7379 run : |
7884 CACHE_KEY="avd-$ARCH-$AVD_CONFIG_HASH"
7985 echo "key=$CACHE_KEY" >> $GITHUB_OUTPUT
8086 - name : Restore AVD cache
87+ if : ${{ fromJSON(inputs.cacheAvd) }}
8188 uses : actions/cache/restore@v4
8289 id : avd-cache
8390 with :
8693 ~/.android/adb*
8794 key : ${{ steps.avd-key.outputs.key }}
8895 - name : Create AVD and generate snapshot for caching
89- if : steps.avd-cache.outputs.cache-hit != 'true'
96+ if : ${{ fromJSON(inputs.cacheAvd) && steps.avd-cache.outputs.cache-hit != 'true' }}
9097 uses : reactivecircus/android-emulator-runner@v2
9198 with :
9299 api-level : ${{ fromJson(steps.load-config.outputs.config).config.device.avd.apiLevel }}
@@ -100,7 +107,7 @@ runs:
100107 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
101108 script : echo "Generated AVD snapshot for caching."
102109 - name : Save AVD cache
103- if : steps.avd-cache.outputs.cache-hit != 'true'
110+ if : ${{ fromJSON(inputs.cacheAvd) && steps.avd-cache.outputs.cache-hit != 'true' }}
104111 uses : actions/cache/save@v4
105112 with :
106113 path : |
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ inputs:
2222 required : false
2323 type : string
2424 default : ' '
25+ cacheAvd :
26+ description : Whether to cache the AVD
27+ required : false
28+ type : boolean
29+ default : ' true'
2530runs :
2631 using : ' composite'
2732 steps :
6873 sudo udevadm trigger --name-match=kvm
6974 ls /dev/kvm
7075 - name : Compute AVD cache key
76+ if : ${{ fromJSON(inputs.cacheAvd) }}
7177 id : avd-key
7278 shell : bash
7379 run : |
7884 CACHE_KEY="avd-$ARCH-$AVD_CONFIG_HASH"
7985 echo "key=$CACHE_KEY" >> $GITHUB_OUTPUT
8086 - name : Restore AVD cache
87+ if : ${{ fromJSON(inputs.cacheAvd) }}
8188 uses : actions/cache/restore@v4
8289 id : avd-cache
8390 with :
8693 ~/.android/adb*
8794 key : ${{ steps.avd-key.outputs.key }}
8895 - name : Create AVD and generate snapshot for caching
89- if : steps.avd-cache.outputs.cache-hit != 'true'
96+ if : ${{ fromJSON(inputs.cacheAvd) && steps.avd-cache.outputs.cache-hit != 'true' }}
9097 uses : reactivecircus/android-emulator-runner@v2
9198 with :
9299 api-level : ${{ fromJson(steps.load-config.outputs.config).config.device.avd.apiLevel }}
@@ -100,7 +107,7 @@ runs:
100107 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
101108 script : echo "Generated AVD snapshot for caching."
102109 - name : Save AVD cache
103- if : steps.avd-cache.outputs.cache-hit != 'true'
110+ if : ${{ fromJSON(inputs.cacheAvd) && steps.avd-cache.outputs.cache-hit != 'true' }}
104111 uses : actions/cache/save@v4
105112 with :
106113 path : |
You can’t perform that action at this time.
0 commit comments