7676 integration_tests :
7777 runs-on : [ ubuntu-latest ]
7878 env :
79- AVD_API_LEVEL : 34
79+ AVD_API_LEVEL : 30
8080 AVD_ARCH : x86_64
8181 steps :
8282 - name : Enable KVM group perms
9494 .github/scripts/deploy_docker_server.sh
9595 echo "CONTAINER_ID=$(docker container ls -q -f name=simple-server)" >> $GITHUB_ENV
9696
97- - name : Cache AVD
98- uses : actions/cache@v4
99- id : avd-cache
100- with :
101- path : |
102- ~/.android/avd/*
103- ~/.android/adb*
104- key : ${{ runner.os }}-avd-${{ env.AVD_API_LEVEL }}-${{ env.AVD_ARCH }}
105-
106- - name : create AVD and generate snapshot for caching
107- if : steps.avd-cache.outputs.cache-hit != 'true'
108- uses : reactivecircus/android-emulator-runner@v2
109- with :
110- api-level : ${{ env.AVD_API_LEVEL }}
111- arch : ${{ env.AVD_ARCH }}
112- force-avd-creation : false
113- emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
114- disable-animations : false
115- disk-size : 8G
116- script : echo "Generated AVD snapshot for caching."
117-
11897 - name : set up JDK
11998 uses : actions/setup-java@v5
12099 with :
@@ -131,26 +110,34 @@ jobs:
131110 ./gradlew --build-cache --no-daemon -PmanifestEndpoint=http://10.0.2.2:3000/api/ assembleQaDebug assembleQaDebugAndroidTest
132111
133112 - name : Android Tests
134- id : run-instrumented-tests
135113 uses : reactivecircus/android-emulator-runner@v2
136114 with :
137115 api-level : ${{ env.AVD_API_LEVEL }}
138116 arch : ${{ env.AVD_ARCH }}
139- force-avd-creation : false
140- emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
117+ force-avd-creation : true
118+ timeout-minutes : 15
119+ emulator-options : >
120+ -no-window
121+ -no-audio
122+ -no-boot-anim
123+ -gpu swiftshader_indirect
124+ -camera-back none
125+ -no-snapshot
141126 disable-animations : true
142127 disk-size : 8G
143128 script : |
129+ adb wait-for-device
130+ adb shell getprop sys.boot_completed | grep -m 1 '1'
131+
144132 adb root
145133 mkdir -p app/build/outputs/test-artifacts
146- adb install app/build/outputs/apk/qa/debug/app-qa-debug.apk
134+ adb install app/build/outputs/apk/qa/debug/app-qa-debug.apk
147135 adb install app/build/outputs/apk/androidTest/qa/debug/app-qa-debug-androidTest.apk
148- adb shell am instrument -w -e filter org.simple.clinic.benchmark.SelectBenchmarkTests -e benchmark_app_performance false org.simple.clinic.qa.debug.test/org.simple.clinic.AndroidTestJUnitRunner >app/build/outputs/test-artifacts/logs.txt 2>app/build/outputs/test-artifacts/logs.txt
149- cat app/build/outputs/test-artifacts/logs.txt
150- adb pull /storage/emulated/0/Android/data/org.simple.clinic.qa.debug/ app/build/outputs/test-artifacts/ || true
151- adb uninstall org.simple.clinic.qa.debug
152- adb uninstall org.simple.clinic.qa.debug.test
153- ! grep -q "FAILURES\!\!\!" app/build/outputs/test-artifacts/logs.txt
136+ adb shell am instrument -w \
137+ -e filter org.simple.clinic.benchmark.SelectBenchmarkTests \
138+ -e benchmark_app_performance false \
139+ org.simple.clinic.qa.debug.test/org.simple.clinic.AndroidTestJUnitRunner \
140+ >app/build/outputs/test-artifacts/logs.txt 2>&1
154141
155142 - name : Upload failed test artifacts
156143 if : always() && steps.run-instrumented-tests.outcome != 'success'
0 commit comments