Skip to content

Commit c29dd40

Browse files
committed
add missing build_java in testing
1 parent 05c31a0 commit c29dd40

File tree

1 file changed

+43
-25
lines changed

1 file changed

+43
-25
lines changed

tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Known Limits
22
# 1. Anchors are not supported in GHA
33
# 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,
55
# which is the no.1 blocker for running tests on modern Android Emulators (especially on recent API levels) on CI.
66

77
jobs:
@@ -75,7 +75,7 @@ jobs:
7575
overWrite: true
7676

7777
- task: CopyFiles@2
78-
displayName: Copy test data
78+
displayName: Copy test data
7979
inputs:
8080
contents: 'build/**/testdata/**'
8181
targetFolder: $(Build.ArtifactStagingDirectory)
@@ -84,7 +84,9 @@ jobs:
8484
- task: CopyFiles@2
8585
displayName: Copy test executables
8686
inputs:
87-
contents: 'build/Debug/*'
87+
contents: |
88+
build/Debug/*
89+
build/Debug/java/androidtest/android/**
8890
targetFolder: $(Build.ArtifactStagingDirectory)
8991
overWrite: true
9092

@@ -114,6 +116,9 @@ jobs:
114116
artifact: 'CPUBuildOutput'
115117
path: $(Build.SourcesDirectory)
116118

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+
117122
- script: |
118123
python3 tools/python/run_android_emulator.py \
119124
--android-sdk-root ${ANDROID_SDK_ROOT} \
@@ -122,6 +127,15 @@ jobs:
122127
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
123128
displayName: Start Android emulator
124129
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+
125139
- script: |
126140
python3 tools/ci_build/build.py \
127141
--android \
@@ -130,6 +144,7 @@ jobs:
130144
--android_ndk_path $ANDROID_NDK_HOME \
131145
--android_abi=x86_64 \
132146
--android_api=30 \
147+
--build_java \
133148
--test
134149
displayName: CPU EP, Test on Android Emulator
135150
@@ -219,15 +234,17 @@ jobs:
219234
- task: CopyFiles@2
220235
displayName: Copy Test Executables
221236
inputs:
222-
contents: 'build_nnapi/Debug/*'
237+
contents: |
238+
build_nnapi/Debug/*
239+
build_nnapi/java/androidtest/android/**
223240
targetFolder: $(Build.ArtifactStagingDirectory)
224241
overWrite: true
225242

226243
- task: PublishBuildArtifacts@1
227244
inputs:
228245
pathToPublish: $(Build.ArtifactStagingDirectory)
229246
artifactName: NNAPIBuildOutput
230-
247+
231248
- template: templates/clean-agent-build-directory-step.yml
232249

233250
- job: Test_NNAPI_EP
@@ -255,14 +272,26 @@ jobs:
255272
inputs:
256273
versionSpec: $(pythonVersion)
257274

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+
258278
- script: |
259279
python3 tools/python/run_android_emulator.py \
260280
--android-sdk-root ${ANDROID_SDK_ROOT} \
261281
--create-avd --system-image "system-images;android-30;google_apis;x86_64" \
262282
--start --emulator-extra-args="-partition-size 4096" \
263283
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
264284
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+
266295
- script: |
267296
python3 tools/ci_build/build.py \
268297
--android \
@@ -271,6 +300,7 @@ jobs:
271300
--android_ndk_path $ANDROID_NDK_HOME \
272301
--android_abi=x86_64 \
273302
--android_api=29 \
303+
--build_java \
274304
--use_nnapi \
275305
--test
276306
displayName: NNAPI EP, Test, CodeCoverage on Android Emulator
@@ -287,18 +317,6 @@ jobs:
287317
$(Build.SourcesDirectory)/protobuf_install
288318
displayName: Build Host Protoc
289319
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-
302320
- script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd)
303321
# Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator
304322
displayName: Build Minimal ORT with NNAPI and run tests
@@ -310,7 +328,7 @@ jobs:
310328
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
311329
displayName: Stop Android emulator
312330
condition: always()
313-
331+
314332
- template: templates/clean-agent-build-directory-step.yml
315333

316334
# The below jobs only run on master build
@@ -346,7 +364,7 @@ jobs:
346364
$(Build.BinariesDirectory)/protobuf \
347365
$(Build.SourcesDirectory)/protobuf_install
348366
displayName: Build Host Protoc
349-
367+
350368
- script: |
351369
python3 tools/python/run_android_emulator.py \
352370
--android-sdk-root ${ANDROID_SDK_ROOT} \
@@ -380,7 +398,7 @@ jobs:
380398
--build_java \
381399
--code_coverage
382400
displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator
383-
401+
384402
- script: |
385403
python3 -m pip install gcovr && \
386404
python3 tools/ci_build/coverage.py \
@@ -408,9 +426,9 @@ jobs:
408426
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
409427
displayName: Stop Android emulator
410428
condition: always()
411-
429+
412430
- template: templates/clean-agent-build-directory-step.yml
413-
431+
414432
- job: Update_Dashboard
415433
workspace:
416434
clean: all
@@ -419,7 +437,7 @@ jobs:
419437
value: true
420438
pool: 'Linux-CPU-2019'
421439
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
422-
dependsOn:
440+
dependsOn:
423441
- Test_CPU_EP
424442
- NNAPI_EP_MASTER
425443
steps:
@@ -437,5 +455,5 @@ jobs:
437455
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
438456
arguments: '"$(Build.BinariesDirectory)/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi'
439457
workingDirectory: '$(Build.BinariesDirectory)'
440-
458+
441459
- template: templates/clean-agent-build-directory-step.yml

0 commit comments

Comments
 (0)