-
-
Notifications
You must be signed in to change notification settings - Fork 91
119 lines (97 loc) · 3.43 KB
/
e2e.yml
File metadata and controls
119 lines (97 loc) · 3.43 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
113
114
115
116
117
118
119
name: E2E
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup
uses: ./.github/actions/setup
- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'zulu'
java-version: '17'
- name: Finalize Android SDK
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Build example for Android
env:
GITHUB_TOKEN: ${{ github.token }}
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
cd example/expo
npx expo run:android --no-install --no-bundler --variant release
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Maestro tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
script: |
adb install example/expo/android/app/build/outputs/apk/release/app-release.apk
maestro test .maestro/ --format junit --output report.xml
- name: Upload test report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: e2e-android-report
path: report.xml
ios:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup
uses: ./.github/actions/setup
- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Build example for iOS
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
cd example/expo
npx expo run:ios --no-install --no-bundler --configuration Release
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Boot iOS Simulator
run: |
DEVICE=$(xcrun simctl list devices available -j | jq -r '[.devices[] | .[] | select(.name | contains("iPhone"))][0].udid')
xcrun simctl boot "$DEVICE"
- name: Install app on Simulator
run: |
APP_PATH=$(find example/expo/ios/build -name "*.app" -path "*/Release-iphonesimulator/*" | head -1)
xcrun simctl install booted "$APP_PATH"
- name: Run Maestro tests
run: maestro test .maestro/ --format junit --output report.xml
- name: Upload test report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: e2e-ios-report
path: report.xml