-
Notifications
You must be signed in to change notification settings - Fork 2
253 lines (221 loc) · 7.95 KB
/
ui_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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: UI Tests
on:
workflow_dispatch:
inputs:
ios_ui_tests:
description: 'IOS UI Tests'
required: false
default: false
type: boolean
android_ui_tests:
description: 'Android UI Tests'
required: false
default: false
type: boolean
env:
flutter_channel: 'stable'
flutter_version: '3.0.2'
java_version: '12.x'
ios_device: 'iPhone 11'
ios_os_version: '>=13.0'
android_api_level: '30'
android_arch: 'x86_64'
target: 'default'
android_profile: 'Galaxy Nexus'
FASTLANE_SKIP_UPDATE_CHECK: '1'
PROVISIONING_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
APPCENTER_IOS_INTERNAL_TOKEN: ${{ secrets.APPCENTER_IOS_INTERNAL_TOKEN }}
SEARCH_API_SECRET_DEBUG: ${{ secrets.SEARCH_API_SECRET_DEBUG }}
SEARCH_API_SECRET_PRODUCTION: ${{ secrets.SEARCH_API_SECRET_PRODUCTION }}
INSTABUG_TOKEN_DEBUG: ${{ secrets.INSTABUG_TOKEN_DEBUG }}
INSTABUG_TOKEN_PRODUCTION: ${{ secrets.INSTABUG_TOKEN_PRODUCTION }}
MIXPANEL_TOKEN_DEBUG: ${{ secrets.MIXPANEL_TOKEN_DEBUG }}
MIXPANEL_TOKEN_PRODUCTION: ${{ secrets.MIXPANEL_TOKEN_PRODUCTION }}
APPSFLYER_DEV_KEY: ${{ secrets.APPSFLYER_DEV_KEY }}
REVENUE_CAT_SDK_KEY_ANDROID: ${{ secrets.REVENUE_CAT_SDK_KEY_ANDROID }}
REVENUE_CAT_SDK_KEY_IOS: ${{ secrets.REVENUE_CAT_SDK_KEY_IOS }}
PROFILES: ${{ secrets.PROFILES }}
RCONFIG_ACCESS_KEY: ${{ secrets.RCONFIG_ACCESS_KEY }}
RCONFIG_SECRET_KEY: ${{ secrets.RCONFIG_SECRET_KEY }}
AIRSHIP_INTERNAL_KEY: ${{ secrets.AIRSHIP_INTERNAL_KEY }}
AIRSHIP_INTERNAL_SECRET: ${{ secrets.AIRSHIP_INTERNAL_SECRET }}
AIRSHIP_PROD_KEY: ${{ secrets.AIRSHIP_PROD_KEY }}
AIRSHIP_PROD_SECRET: ${{ secrets.AIRSHIP_PROD_SECRET }}
GOOGLE_SERVICES_INTERNAL_JSON: ${{ secrets.GOOGLE_SERVICES_INTERNAL_JSON }}
GOOGLE_SERVICES_PROD_JSON: ${{ secrets.GOOGLE_SERVICES_PROD_JSON }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
ui-tests-ios:
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.ios_ui_tests == 'true')
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: |
/Users/runner/hostedtoolcache/flutter
~/application/ios/Pods
key: ios-flutter-${{ env.flutter_version }}
restore-keys: |
ios-flutter-cache-
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Install Appium
run: npm install -g appium
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- shell: bash
run: brew install ffmpeg
- shell: bash
run: brew install allure
- name: Set up a Simulator
uses: futureware-tech/simulator-action@v1
with:
model: ${{ env.ios_device }}
os_version: ${{ env.ios_os_version }}
erase_before_boot: false
shutdown_after_job: false
# Hard coded for now
- shell: bash
run: xcrun simctl bootstatus B7E7086A-60F8-48F2-BF82-AF153D7AF925
- shell: bash
run: xcrun simctl io booted screenshot screenshot.png
- name: Upload screenshot
uses: actions/upload-artifact@v3
with:
name: boot_screenshot
path: screenshot.png
- name: Run build runner
working-directory: ./application
run:
fastlane build_runner
- name: Run UI Tests
timeout-minutes: 30
working-directory: ./application
run:
fastlane run_automation platform:ios test_suite:sanity_ios
# flutter test integration_test
- name: Generate Report
if: always()
working-directory: ./application/automation/target/artifacts
run: allure generate --output ios/allure-report
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts
path: ./application/automation/target/artifacts
ui-tests-android:
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.android_ui_tests == 'true')
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: |
/Users/runner/hostedtoolcache/flutter
~/application/ios/Pods
key: ios-flutter-${{ env.flutter_version }}
restore-keys: |
ios-flutter-cache-
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.android_api_level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
ram-size: 4096M
api-level: ${{ env.android_api_level }}
arch: ${{ env.android_arch }}
target: ${{ env.target }}
profile: ${{ env.android_profile }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Install Appium
run: npm install -g appium
- name: Install Allure Report
run: brew install allure
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- run: java -version
- name: Set Up Emulator And Run Tests
timeout-minutes: 60
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.android_api_level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
ram-size: 4096M
arch: ${{ env.android_arch }}
target: ${{ env.target }}
profile: ${{ env.android_profile }}
working-directory: application/
script: |
fastlane run_automation platform:android test_suite:sanity_android
- name: Generate Report
if: always()
working-directory: ./application/automation/target/artifacts
run: allure generate --output android/allure-report
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts
path: ./application/automation/target/artifacts