-
Notifications
You must be signed in to change notification settings - Fork 4
188 lines (151 loc) · 4.95 KB
/
android-and-ios-github-actions-macos.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Android & iOS E2E (Github Actions MacOS)
on: [push, pull_request]
env:
MAESTRO_VERSION: 1.30.4
jobs:
run_android_e2e:
timeout-minutes: 30
runs-on: macos-12
strategy:
fail-fast: false
max-parallel: 3
matrix:
arch: [ x86, x86_64 ]
# ^^^ `runs-on: macos-*` doesn't support `arm64-v8a`
api-level: [ 26, 27, 28, 29, 30, 31, 32, 33, 34 ]
# ^^^ `21` is the minimum API level supported by React Native
# [21, 22, 23, 24, 25,] - didn't work with Maestro
target: [ default, google_apis, google_apis_playstore ]
exclude:
# Exclude combinations that are not supported by the Android SDK
# Print all available Android emulators: `sdkmanager --list --verbose | grep system-images`
# x85
- arch: x86
api-level: 31
- arch: x86
api-level: 32
- arch: x86
api-level: 33
- arch: x86
api-level: 34
# default
- target: default
api-level: 30
arch: x86
- target: default
api-level: 31
arch: x86
- target: default
api-level: 32
- target: default
api-level: 33
- target: default
api-level: 34
# google_apis
- target: google_apis
api-level: 27
arch: x86_64
# google_apis_playstore
- target: google_apis_playstore
api-level: 21
- target: google_apis_playstore
api-level: 22
- target: google_apis_playstore
api-level: 23
- target: google_apis_playstore
api-level: 24
arch: x86_64
- target: google_apis_playstore
api-level: 25
arch: x86_64
- target: google_apis_playstore
api-level: 26
arch: x86_64
- target: google_apis_playstore
api-level: 27
arch: x86_64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- run: npx envinfo
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install Maestro
run: curl -Ls 'https://get.maestro.mobile.dev' | bash
- name: Run Maestro E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
cores: 2
ram-size: 2048M
force-avd-creation: false
emulator-boot-timeout: 600 # 10min
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
pre-emulator-launch-script: |
echo "Running pre emulator launch script. Printing the working directory now:"
pwd
script: |
npx envinfo # check memory usage
adb devices # verify emulator is running
adb install app-release.apk # install app
# Run e2e
./run_android_e2e.sh
# ^^^ Will debug files: report*.xml, video_record.mp4, last_img.png
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: E2E Report (${{ matrix.arch }}, ${{ matrix.api-level }}, ${{ matrix.target }})
path: |
${{ github.workspace }}/*.mp4
${{ github.workspace }}/*.png
${{ github.workspace }}/report*.xml
~/.maestro/tests/**/*
run_ios_e2e:
runs-on: macos-12
env:
XC_SIMULATOR_NAME: iPhone 14
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Run iOS Simulator
run: |
echo "All valid available device types"
xcrun simctl list devicetypes
echo "All valid and available runtimes"
xcrun simctl list runtimes
echo "Run simulator"
xcrun simctl boot "${{ env.XC_SIMULATOR_NAME }}"
- run: npx envinfo
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install Maestro
run: |
brew tap facebook/fb
brew install facebook/fb/idb-companion
curl -Ls 'https://get.maestro.mobile.dev' | bash
- name: Install .app
run: xcrun simctl install booted ./MyApp.app
- name: Run Maestro E2E tests
run: ./run_ios_e2e.sh
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: E2E Report (iPhone 14)
path: |
${{ github.workspace }}/*.mp4
${{ github.workspace }}/*.png
${{ github.workspace }}/report*.xml
~/.maestro/tests/**/*