-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (102 loc) · 4.14 KB
/
maestro.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: E2E CI
on:
push:
branches:
- chore/maestro-ci
jobs:
run-tests:
runs-on: ubuntu-22.04-arm64-2cpu
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get APK for testing
run: |
curl -o test.apk "https://github.com/digidem/comapeo-mobile/releases/download/untagged-142428c7d3d78b089aab/CoMapeo0.0.apk"
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up environment variables
run: |
mkdir -p $HOME/lib/android/sdk
echo "ANDROID_HOME=$HOME/lib/android/sdk" >> $GITHUB_ENV
- name: Install Maestro
run: curl -Ls 'https://get.maestro.mobile.dev' | bash
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'platform-tools'
# https://github.com/lzhiyong/android-sdk-tools/releases
- name: Install ADB
run: |
curl --compressed --location --output tools.zip https://github.com/lzhiyong/android-sdk-tools/releases/download/34.0.3/android-sdk-tools-static-aarch64.zip
unzip -d tools -n -q tools.zip
rm -f tools.zip
cp tools/platform-tools/adb $ANDROID_HOME/platform-tools/adb
rm -fr tools
shell: bash
# https://ci.android.com/builds/branches/aosp-emu-master-dev/grid
- name: Install Emulator
run: |
curl --compressed --location --output emulator.zip $(curl --location --silent https://ci.android.com/builds/submitted/11162281/emulator-linux_aarch64/latest/sdk-repo-linux_aarch64-emulator-11162281.zip | grep -o 'https://storage[^"]*' | sed 's/\\u0026/\&/g')
unzip -d $ANDROID_HOME -n -q emulator.zip
rm -f emulator.zip
cp $ANDROID_HOME/platform-tools/package.xml $ANDROID_HOME/emulator/package.xml
sed -i \
-e 's|path="[a-zA-Z-]*"|path="emulator"|g' \
-e 's|<display-name>Android .*<\/display-name>|<display-name>Android Emulator<\/display-name>|g' \
$ANDROID_HOME/emulator/package.xml
echo 'Vulkan = off\nGLDirectMem = on' >> ~/.android/advancedFeatures.ini
shell: bash
- name: Install SDK Tools
run: |
sdkmanager 'platforms;android-34' 'system-images;android-34;google_apis;arm64-v8a' 'tools'
bash -c 'yes || true' | sdkmanager --licenses
shell: bash
- name: Create virtual device
run: |
echo no | avdmanager create avd --force --name test -k 'system-images;android-34;google_apis;arm64-v8a'
avdmanager list avd
echo "Emulator version:"
$ANDROID_HOME/emulator/emulator @emu -version
echo "Hardware acceleration:"
$ANDROID_HOME/emulator/emulator -accel-check
shell: bash
- name: Start emulator
run: |
$ANDROID_HOME/emulator/emulator -avd emu -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back emulated
shell: bash
- name: Wait for emulator to boot
run: |
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 3; done; input keyevent 82'
echo "Device booted. Listing connected devices:"
adb devices
shell: bash
- name: Install APK
run: |
adb install test.apk
shell: bash
- name: Run Maestro tests
run: |
$HOME/.maestro/bin/maestro test e2e || true
adb logcat -d > logcat_output.txt
shell: bash
- name: Upload Logcat Output
uses: actions/upload-artifact@v4
with:
name: logcat-output
path: logcat_output.txt
- name: Upload Maestro test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-test-results
path: /home/runner/.maestro/tests/*/
- name: Upload Screen Recording
if: always()
uses: actions/upload-artifact@v4
with:
name: E2E Screen Recording
path: ${{ github.workspace }}/recording-e2e-flow.*