88 pull_request :
99 paths-ignore :
1010 - " **.md"
11+ workflow_dispatch :
1112
1213jobs :
1314 build :
6465 env :
6566 DOTNET_CLI_TELEMETRY_OPTOUT : 1
6667 DOTNET_NOLOGO : 1
68+ # We don't need the Google APIs, but the default images are not available for 32+
69+ ANDROID_EMULATOR_TARGET : google_apis
70+ ANDROID_EMULATOR_RAM_SIZE : 2048M
71+ ANDROID_EMULATOR_ARCH : x86_64
72+ ANDROID_EMULATOR_DISK_SIZE : 4096M
73+ ANDROID_EMULATOR_OPTIONS : -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
6774 steps :
6875 # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
6976 - name : Enable KVM group perms
@@ -87,17 +94,33 @@ jobs:
8794 # Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
8895
8996 - name : Run Tests
97+ id : first-run
98+ continue-on-error : true
9099 timeout-minutes : 40
91100 uses : reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # Tag: v2.34.0
92101 with :
93102 api-level : ${{ matrix.api-level }}
94- # We don't need the Google APIs, but the default images are not available for 32+
95- target : google_apis
103+ target : ${{ env.ANDROID_EMULATOR_TARGET }}
96104 force-avd-creation : false
97- ram-size : 2048M
98- arch : x86_64
99- disk-size : 4096M
100- emulator-options : -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
105+ ram-size : ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
106+ arch : ${{ env.ANDROID_EMULATOR_ARCH }}
107+ disk-size : ${{ env.ANDROID_EMULATOR_DISK_SIZE }}
108+ emulator-options : ${{ env.ANDROID_EMULATOR_OPTIONS }}
109+ disable-animations : false
110+ script : pwsh scripts/device-test.ps1 android -Run -Tfm ${{ matrix.tfm }}
111+
112+ - name : Retry Tests (if previous failed to run)
113+ if : steps.first-run.outcome == 'failure'
114+ timeout-minutes : 40
115+ uses : reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # Tag: v2.34.0
116+ with :
117+ api-level : ${{ matrix.api-level }}
118+ target : ${{ env.ANDROID_EMULATOR_TARGET }}
119+ force-avd-creation : false
120+ ram-size : ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
121+ arch : ${{ env.ANDROID_EMULATOR_ARCH }}
122+ disk-size : ${{ env.ANDROID_EMULATOR_DISK_SIZE }}
123+ emulator-options : ${{ env.ANDROID_EMULATOR_OPTIONS }}
101124 disable-animations : false
102125 script : pwsh scripts/device-test.ps1 android -Run -Tfm ${{ matrix.tfm }}
103126
0 commit comments