-
Notifications
You must be signed in to change notification settings - Fork 75
90 lines (76 loc) · 2.69 KB
/
Copy pathe2e-android.yml
File metadata and controls
90 lines (76 loc) · 2.69 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
name: E2E Tests (Android)
on:
# Run on demand or when deploy label is added
workflow_dispatch:
pull_request:
types: [labeled]
concurrency:
group: e2e-android-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
e2e-android:
name: Maestro E2E (Android)
# Only run when 'e2e-test' label is added or on manual dispatch
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'e2e-test'))
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 12266719
- name: Create .env file
run: |
echo "ACTIVITY_WEBSOCKET_URL=${{ secrets.ACTIVITY_WEBSOCKET_URL }}" >> .env
echo "DEFAULT_PIN=${{ secrets.DEFAULT_PIN }}" >> .env
echo "ECENCY_BACKEND_API=${{ secrets.ECENCY_BACKEND_API }}" >> .env
echo "NEW_IMAGE_API=${{ secrets.NEW_IMAGE_API }}" >> .env
echo "PIN_KEY=${{ secrets.PIN_KEY }}" >> .env
echo "USER_AGENT=${{ secrets.USER_AGENT }}" >> .env
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create Google Services JSON
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_JSON }}
run: echo $GOOGLE_JSON | base64 --decode > ./android/app/google-services.json
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Build debug APK
run: |
cd android
./gradlew assembleDebug
- name: Run Maestro E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
profile: pixel_6
heap-size: 512M
ram-size: 4096M
emulator-options: -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/ --format junit --output maestro-results.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-results
path: maestro-results.xml
retention-days: 30