1
1
# Known Limits
2
2
# 1. Anchors are not supported in GHA
3
3
# https://github.community/t/support-for-yaml-anchors/16128/90
4
- # 2. today most cloud-based CI services are still lacking hardware acceleration support from the host VM,
4
+ # 2. today most cloud-based CI services are still lacking hardware acceleration support from the host VM,
5
5
# which is the no.1 blocker for running tests on modern Android Emulators (especially on recent API levels) on CI.
6
6
7
7
jobs :
75
75
overWrite : true
76
76
77
77
- task : CopyFiles@2
78
- displayName : Copy test data
78
+ displayName : Copy test data
79
79
inputs :
80
80
contents : ' build/**/testdata/**'
81
81
targetFolder : $(Build.ArtifactStagingDirectory)
84
84
- task : CopyFiles@2
85
85
displayName : Copy test executables
86
86
inputs :
87
- contents : ' build/Debug/*'
87
+ contents : |
88
+ build/Debug/*
89
+ build/Debug/java/androidtest/android/**
88
90
targetFolder : $(Build.ArtifactStagingDirectory)
89
91
overWrite : true
90
92
@@ -114,6 +116,9 @@ jobs:
114
116
artifact : ' CPUBuildOutput'
115
117
path : $(Build.SourcesDirectory)
116
118
119
+ - script : /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
120
+ displayName : Setup gradle wrapper to use gradle 6.8.3
121
+
117
122
- script : |
118
123
python3 tools/python/run_android_emulator.py \
119
124
--android-sdk-root ${ANDROID_SDK_ROOT} \
@@ -122,6 +127,15 @@ jobs:
122
127
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
123
128
displayName: Start Android emulator
124
129
130
+ # Start switching to jdk 11 after the Android Emulator is started
131
+ # since Android SDK manager requires java 8
132
+ - task : JavaToolInstaller@0
133
+ displayName : Use jdk 11
134
+ inputs :
135
+ versionSpec : ' 11'
136
+ jdkArchitectureOption : ' x64'
137
+ jdkSourceOption : ' PreInstalled'
138
+
125
139
- script : |
126
140
python3 tools/ci_build/build.py \
127
141
--android \
@@ -130,6 +144,7 @@ jobs:
130
144
--android_ndk_path $ANDROID_NDK_HOME \
131
145
--android_abi=x86_64 \
132
146
--android_api=30 \
147
+ --build_java \
133
148
--test
134
149
displayName: CPU EP, Test on Android Emulator
135
150
@@ -219,15 +234,17 @@ jobs:
219
234
- task : CopyFiles@2
220
235
displayName : Copy Test Executables
221
236
inputs :
222
- contents : ' build_nnapi/Debug/*'
237
+ contents : |
238
+ build_nnapi/Debug/*
239
+ build_nnapi/java/androidtest/android/**
223
240
targetFolder : $(Build.ArtifactStagingDirectory)
224
241
overWrite : true
225
242
226
243
- task : PublishBuildArtifacts@1
227
244
inputs :
228
245
pathToPublish : $(Build.ArtifactStagingDirectory)
229
246
artifactName : NNAPIBuildOutput
230
-
247
+
231
248
- template : templates/clean-agent-build-directory-step.yml
232
249
233
250
- job : Test_NNAPI_EP
@@ -255,14 +272,26 @@ jobs:
255
272
inputs :
256
273
versionSpec : $(pythonVersion)
257
274
275
+ - script : /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
276
+ displayName : Setup gradle wrapper to use gradle 6.8.3
277
+
258
278
- script : |
259
279
python3 tools/python/run_android_emulator.py \
260
280
--android-sdk-root ${ANDROID_SDK_ROOT} \
261
281
--create-avd --system-image "system-images;android-30;google_apis;x86_64" \
262
282
--start --emulator-extra-args="-partition-size 4096" \
263
283
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
264
284
displayName: Start Android emulator
265
-
285
+
286
+ # Start switching to jdk 11 after the Android Emulator is started
287
+ # since Android SDK manager requires java 8
288
+ - task : JavaToolInstaller@0
289
+ displayName : Use jdk 11
290
+ inputs :
291
+ versionSpec : ' 11'
292
+ jdkArchitectureOption : ' x64'
293
+ jdkSourceOption : ' PreInstalled'
294
+
266
295
- script : |
267
296
python3 tools/ci_build/build.py \
268
297
--android \
@@ -271,6 +300,7 @@ jobs:
271
300
--android_ndk_path $ANDROID_NDK_HOME \
272
301
--android_abi=x86_64 \
273
302
--android_api=29 \
303
+ --build_java \
274
304
--use_nnapi \
275
305
--test
276
306
displayName: NNAPI EP, Test, CodeCoverage on Android Emulator
@@ -287,18 +317,6 @@ jobs:
287
317
$(Build.SourcesDirectory)/protobuf_install
288
318
displayName: Build Host Protoc
289
319
290
- - script : /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
291
- displayName : Setup gradle wrapper to use gradle 6.8.3
292
-
293
- # Start switching to jdk 11 after the Android Emulator is started
294
- # since Android SDK manager requires java 8
295
- - task : JavaToolInstaller@0
296
- displayName : Use jdk 11
297
- inputs :
298
- versionSpec : ' 11'
299
- jdkArchitectureOption : ' x64'
300
- jdkSourceOption : ' PreInstalled'
301
-
302
320
- script : /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd)
303
321
# Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator
304
322
displayName : Build Minimal ORT with NNAPI and run tests
@@ -310,7 +328,7 @@ jobs:
310
328
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
311
329
displayName: Stop Android emulator
312
330
condition: always()
313
-
331
+
314
332
- template : templates/clean-agent-build-directory-step.yml
315
333
316
334
# The below jobs only run on master build
@@ -346,7 +364,7 @@ jobs:
346
364
$(Build.BinariesDirectory)/protobuf \
347
365
$(Build.SourcesDirectory)/protobuf_install
348
366
displayName: Build Host Protoc
349
-
367
+
350
368
- script : |
351
369
python3 tools/python/run_android_emulator.py \
352
370
--android-sdk-root ${ANDROID_SDK_ROOT} \
@@ -380,7 +398,7 @@ jobs:
380
398
--build_java \
381
399
--code_coverage
382
400
displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator
383
-
401
+
384
402
- script : |
385
403
python3 -m pip install gcovr && \
386
404
python3 tools/ci_build/coverage.py \
@@ -408,9 +426,9 @@ jobs:
408
426
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
409
427
displayName: Stop Android emulator
410
428
condition: always()
411
-
429
+
412
430
- template : templates/clean-agent-build-directory-step.yml
413
-
431
+
414
432
- job : Update_Dashboard
415
433
workspace :
416
434
clean : all
@@ -419,7 +437,7 @@ jobs:
419
437
value : true
420
438
pool : ' Linux-CPU-2019'
421
439
condition : and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
422
- dependsOn :
440
+ dependsOn :
423
441
- Test_CPU_EP
424
442
- NNAPI_EP_MASTER
425
443
steps :
@@ -437,5 +455,5 @@ jobs:
437
455
scriptPath : $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
438
456
arguments : ' "$(Build.BinariesDirectory)/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi'
439
457
workingDirectory : ' $(Build.BinariesDirectory)'
440
-
458
+
441
459
- template : templates/clean-agent-build-directory-step.yml
0 commit comments