-
Notifications
You must be signed in to change notification settings - Fork 69
113 lines (94 loc) · 3.2 KB
/
Copy pathe2e-android.yml
File metadata and controls
113 lines (94 loc) · 3.2 KB
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
name: E2E Android
on:
workflow_dispatch:
concurrency:
group: e2e-android-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-android:
name: E2E Android Smoke
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create env file
env:
ENV_FILE: ${{ secrets.ENV_DEVELOPMENT }}
run: |
echo "$ENV_FILE" > .env.development
echo "IS_MAESTRO=true" >> .env.development
- name: Create Sentry properties
run: |
echo "${{ secrets.SENTRY_PROPERTIES }}" > sentry.properties
echo "${{ secrets.SENTRY_PROPERTIES }}" > ios/sentry.properties
echo "${{ secrets.SENTRY_PROPERTIES }}" > android/sentry.properties
- name: Set native config values
run: yarn set:dev
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('android/**/*.gradle*', 'android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: gradle-
- name: Cache Maestro
uses: actions/cache@v4
with:
path: ~/.maestro
key: maestro-${{ runner.os }}
restore-keys: maestro-${{ runner.os }}
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Build Android APK (debug)
run: |
cd android
./gradlew assembleDebug --no-daemon
- name: Enable KVM for emulator
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Start Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
arch: x86_64
profile: pixel_6
avd-name: e2e-emulator
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
disable-animations: true
script: |
adb install android/app/build/outputs/apk/debug/app-debug.apk
maestro test .maestro/flows/ --format junit --output maestro-results.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v5
with:
name: maestro-android-results
path: |
maestro-results.xml
~/.maestro/tests/
retention-days: 7
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v5
with:
name: maestro-android-screenshots
path: ~/.maestro/tests/**/*.png
retention-days: 7