82
82
scheme : ' OrtBasicUsage'
83
83
args : $(XcodeArgs)
84
84
85
+ # mobile/examples/speech_recognition/android
86
+ - job : SpeechRecognitionAndroid
87
+ pool :
88
+ vmImage : " macOS-12"
89
+
90
+ steps :
91
+ - template : templates/use-python-step.yml
92
+
93
+ - template : templates/use-jdk-step.yml
94
+ parameters :
95
+ jdkVersion : " 17"
96
+
97
+ - template : templates/run-with-android-emulator-steps.yml
98
+ parameters :
99
+ steps :
100
+ - bash : |
101
+ set -e
102
+ ./gradlew connectedDebugAndroidTest --no-daemon
103
+ workingDirectory: mobile/examples/speech_recognition/android
104
+ displayName: "Build and run tests"
105
+
85
106
# mobile/examples/speech_recognition/ios
86
107
- job : SpeechRecognitionIos
87
108
pool :
@@ -185,12 +206,7 @@ jobs:
185
206
steps :
186
207
- template : templates/use-python-step.yml
187
208
188
- - task : JavaToolInstaller@0
189
- displayName : Use jdk 11
190
- inputs :
191
- versionSpec : " 11"
192
- jdkArchitectureOption : " x64"
193
- jdkSourceOption : " PreInstalled"
209
+ - template : templates/use-jdk-step.yml
194
210
195
211
- bash : |
196
212
set -e
@@ -208,25 +224,12 @@ jobs:
208
224
cat ${GRADLE_FILE}
209
225
displayName: "Update build.gradle"
210
226
211
- - script : |
212
- python3 ./ci_build/python/run_android_emulator.py \
213
- --android-sdk-root ${ANDROID_SDK_ROOT} \
214
- --create-avd --system-image "system-images;android-30;default;x86_64" \
215
- --start --emulator-extra-args="-partition-size 4096" \
216
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
217
- displayName: "Start Android emulator"
218
-
219
- - bash : ./gradlew testDebugUnitTest connectedDebugAndroidTest
220
- workingDirectory : mobile/examples/image_classification/android
221
- displayName : " Build and run tests"
222
-
223
- - script : |
224
- python3 ./ci_build/python/run_android_emulator.py \
225
- --android-sdk-root ${ANDROID_SDK_ROOT} \
226
- --stop \
227
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
228
- displayName: "Stop Android emulator"
229
- condition: always()
227
+ - template : templates/run-with-android-emulator-steps.yml
228
+ parameters :
229
+ steps :
230
+ - bash : ./gradlew connectedDebugAndroidTest --no-daemon
231
+ workingDirectory : mobile/examples/image_classification/android
232
+ displayName : " Build and run tests"
230
233
231
234
# Note: start with testing with the included aar package,
232
235
# can update with testing with Full/Mobile packages as the other samples later.
@@ -238,36 +241,17 @@ jobs:
238
241
239
242
steps :
240
243
- template : templates/use-python-step.yml
241
-
242
- - script : |
243
- python3 ./ci_build/python/run_android_emulator.py \
244
- --android-sdk-root ${ANDROID_SDK_ROOT} \
245
- --create-avd --system-image "system-images;android-30;default;x86_64" \
246
- --start --emulator-extra-args="-partition-size 4096" \
247
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
248
- displayName: "Start Android emulator"
249
244
250
- - task : JavaToolInstaller@0
251
- displayName : Use jdk 11
252
- inputs :
253
- versionSpec : " 11"
254
- jdkArchitectureOption : " x64"
255
- jdkSourceOption : " PreInstalled"
245
+ - template : templates/use-jdk-step.yml
256
246
257
- - bash : |
258
- set -e
259
- chmod +x ./gradlew
260
- ./gradlew connectedDebugAndroidTest --no-daemon
261
- workingDirectory: mobile/examples/super_resolution/android
262
- displayName: "Build and run tests"
263
-
264
- - script : |
265
- python ./ci_build/python/run_android_emulator.py \
266
- --android-sdk-root ${ANDROID_SDK_ROOT} \
267
- --stop \
268
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
269
- displayName: "Stop Android emulator"
270
- condition: always()
247
+ - template : templates/run-with-android-emulator-steps.yml
248
+ parameters :
249
+ steps :
250
+ - bash : |
251
+ set -e
252
+ ./gradlew connectedDebugAndroidTest --no-daemon
253
+ workingDirectory: mobile/examples/super_resolution/android
254
+ displayName: "Build and run tests"
271
255
272
256
# Note: start with testing with the pre-release version pods.
273
257
# can update with testing with Full/Mobile pods as the other samples later.
@@ -288,6 +272,7 @@ jobs:
288
272
xcWorkspacePath : ' mobile/examples/super_resolution/ios/ORTSuperResolution/ORTSuperResolution.xcworkspace'
289
273
scheme : ' ORTSuperResolution'
290
274
275
+ # mobile/examples/question_answering/android
291
276
- job : QuestionAnsweringAndroid
292
277
pool :
293
278
vmImage : " macOS-12"
@@ -299,36 +284,19 @@ jobs:
299
284
bash ./prepare_model.sh
300
285
workingDirectory: 'mobile/examples/question_answering/android'
301
286
displayName: "Generate model"
302
-
303
- - script : |
304
- python3 ./ci_build/python/run_android_emulator.py \
305
- --android-sdk-root ${ANDROID_SDK_ROOT} \
306
- --create-avd --system-image "system-images;android-30;default;x86_64" \
307
- --start --emulator-extra-args="-partition-size 4096" \
308
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
309
- displayName: "Start Android emulator"
310
287
311
- - task : JavaToolInstaller@0
312
- displayName : Use jdk 11
313
- inputs :
314
- versionSpec : " 11"
315
- jdkArchitectureOption : " x64"
316
- jdkSourceOption : " PreInstalled"
317
-
318
- - bash : |
319
- set -e
320
- ./gradlew connectedDebugAndroidTest --no-daemon
321
- workingDirectory: mobile/examples/question_answering/android
322
- displayName: "Build and run tests"
323
-
324
- - script : |
325
- python ./ci_build/python/run_android_emulator.py \
326
- --android-sdk-root ${ANDROID_SDK_ROOT} \
327
- --stop \
328
- --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
329
- displayName: "Stop Android emulator"
330
- condition: always()
288
+ - template : templates/use-jdk-step.yml
331
289
290
+ - template : templates/run-with-android-emulator-steps.yml
291
+ parameters :
292
+ steps :
293
+ - bash : |
294
+ set -e
295
+ ./gradlew connectedDebugAndroidTest --no-daemon
296
+ workingDirectory: mobile/examples/question_answering/android
297
+ displayName: "Build and run tests"
298
+
299
+ # mobile/examples/question_answering/ios
332
300
- job : QuestionAnsweringIos
333
301
pool :
334
302
vmImage : " macOS-12"
@@ -341,4 +309,4 @@ jobs:
341
309
- template : templates/xcode-build-and-test-step.yml
342
310
parameters :
343
311
xcWorkspacePath : ' mobile/examples/question_answering/ios/ORTQuestionAnswering/ORTQuestionAnswering.xcworkspace'
344
- scheme : ' ORTQuestionAnswering'
312
+ scheme : ' ORTQuestionAnswering'
0 commit comments