Skip to content

Commit 31b4de5

Browse files
committed
CI: Launch app in emulator before granting notifications permissions and running instrumented tests
1 parent b833244 commit 31b4de5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/android.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ jobs:
2525
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
2626
sudo udevadm control --reload-rules
2727
sudo udevadm trigger --name-match=kvm
28+
- name: Build app
29+
run: ./gradlew clean build
30+
- name: Prepare app for instrumented tests
31+
run: |
32+
adb install -r -t app/build/outputs/apk/debug/app-debug.apk
33+
adb shell am start -n com.readrops.app.debug/com.readrops.app.MainActivity
34+
adb shell settings put global zen_mode 0
35+
adb shell pm grant com.readrops.app.debug android.permission.POST_NOTIFICATIONS
36+
adb shell pm grant com.readrops.app android.permission.POST_NOTIFICATIONS
2837
- name: Android Emulator Runner
2938
uses: ReactiveCircus/android-emulator-runner@v2.33.0
3039
with:
31-
api-level: 29
32-
pre-emulator-launch-script: |
33-
adb shell settings put global zen_mode 0
34-
adb shell pm grant com.readrops.app android.permission.POST_NOTIFICATIONS
35-
adb shell input keyevent KEYCODE_WAKEUP
36-
adb shell wm dismiss-keyguard
37-
adb shell input keyevent KEYCODE_MENU
38-
script: ./gradlew clean build connectedCheck jacocoFullReport
40+
api-level: 34
41+
script: ./gradlew connectedCheck jacocoFullReport
3942
- uses: codecov/codecov-action@v4
4043
with:
4144
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)