-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.85 KB
/
e2e-tests.yaml
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
name: React Native E2E Tests
on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main, develop ]
workflow_dispatch:
jobs:
android-e2e-tests:
name: Android E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Increase Java heap space
run: |
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError" >> android/gradle.properties
echo "org.gradle.daemon=false" >> android/gradle.properties
- name: Run Android app and Maestro tests
uses: reactivecircus/android-emulator-runner@v2
env:
JAVA_TOOL_OPTIONS: -Xmx4g
with:
api-level: 29
arch: x86_64
profile: Nexus 6
script: |
echo "Building and running React Native Android app"
cd android && ./gradlew clean
cd .. && yarn android --no-packager
echo "Installing Maestro..."
curl -Ls "https://get.maestro.mobile.dev" | bash
echo 'export PATH="$PATH:$HOME/.maestro/bin"' >> $GITHUB_ENV
source $GITHUB_ENV
echo "Verifying Maestro installation..."
$HOME/.maestro/bin/maestro --version
echo "Running Maestro tests..."
$HOME/.maestro/bin/maestro test e2e/main-flow-android.yaml
- name: Upload Maestro logs
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-android-logs
path: ~/.maestro/logs