Skip to content

Commit dcdd006

Browse files
update emulator-test
1 parent b00a1f9 commit dcdd006

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/android-ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,37 @@ jobs:
132132
uses: ./.github/actions/emulator-step
133133
with:
134134
api-level: ${{ matrix.api-level }}
135+
emulator-options: >
136+
-no-window
137+
-no-boot-anim
138+
-gpu swiftshader_indirect
139+
-noaudio
140+
-camera-back none
141+
-camera-front none
142+
disable-animations: true
135143
script: echo "Generated AVD snapshot for caching."
136144
- name: Build app and test APKs
137145
run: ./gradlew assembleDebug assembleDebugAndroidTest
138146
- name: Run instrumented tests
139147
uses: ./.github/actions/emulator-step
140148
with:
141149
api-level: ${{ matrix.api-level }}
142-
script: ./gradlew connectedDebugAndroidTest -x assembleDebug -x assembleDebugAndroidTest
150+
emulator-options: >
151+
-no-window
152+
-no-boot-anim
153+
-gpu swiftshader_indirect
154+
-noaudio
155+
-camera-back none
156+
-camera-front none
157+
disable-animations: true
158+
script: |
159+
adb wait-for-device
160+
# Wait until Android system UI is fully ready
161+
until adb shell getprop sys.boot_completed | grep -m 1 "1"; do sleep 2; done
162+
adb shell settings put global window_animation_scale 0
163+
adb shell settings put global transition_animation_scale 0
164+
adb shell settings put global animator_duration_scale 0
165+
./gradlew connectedDebugAndroidTest -x assembleDebug -x assembleDebugAndroidTest
143166
- name: Upload test results
144167
uses: actions/upload-artifact@v7
145168
if: always()
@@ -151,4 +174,3 @@ jobs:
151174
if: always()
152175
with:
153176
report_paths: 'app/build/outputs/androidTest-results/connected/**/*.xml'
154-

0 commit comments

Comments
 (0)