-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add full Android job in package pipeline (#9009)
* Add full Android job in package pipeline * Address CR comments
- Loading branch information
1 parent
c20cb76
commit 1533f57
Showing
5 changed files
with
158 additions
and
74 deletions.
There are no files selected for viewing
29 changes: 19 additions & 10 deletions
29
tools/ci_build/github/android/build_aar_and_copy_artifacts.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tools/ci_build/github/android/default_full_aar_build_settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"build_abis": [ | ||
"armeabi-v7a", | ||
"arm64-v8a", | ||
"x86", | ||
"x86_64" | ||
], | ||
"android_min_sdk_version": 21, | ||
"android_target_sdk_version": 24, | ||
"build_params": [ | ||
"--android", | ||
"--parallel", | ||
"--cmake_generator=Ninja", | ||
"--build_java", | ||
"--build_shared_lib", | ||
"--use_nnapi", | ||
"--skip_tests" | ||
] | ||
} |
71 changes: 71 additions & 0 deletions
71
tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
parameters: | ||
- name: artifactName | ||
displayName: Artifact Name | ||
type: string | ||
default: '' | ||
|
||
- name: job_name_suffix | ||
displayName: job name | ||
type: string | ||
default: '' | ||
|
||
jobs: | ||
- job: Final_AAR_Testing_Android_${{ parameters.job_name_suffix }} | ||
workspace: | ||
clean: all | ||
pool: | ||
vmImage: 'macOS-10.15' | ||
variables: | ||
- name: runCodesignValidationInjection | ||
value: false | ||
timeoutInMinutes: 60 | ||
dependsOn: | ||
- Android_Java_API_AAR_Packaging_${{ parameters.job_name_suffix }} | ||
steps: | ||
- template: set-version-number-variables-step.yml | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
displayName: 'Download Final Android AAR' | ||
inputs: | ||
buildType: 'current' | ||
artifactName: '${{parameters.artifactName}}' | ||
targetPath: '$(Build.BinariesDirectory)/final-android-aar' | ||
|
||
- script: /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(Build.SourcesDirectory) | ||
displayName: Setup gradle wrapper to use gradle 6.8.3 | ||
|
||
- script: | | ||
python3 $(Build.SourcesDirectory)/tools/python/run_android_emulator.py \ | ||
--android-sdk-root ${ANDROID_SDK_ROOT} \ | ||
--create-avd --system-image "system-images;android-30;google_apis;x86_64" \ | ||
--start --emulator-extra-args="-partition-size 4096" \ | ||
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid | ||
displayName: Start Android emulator | ||
- script: | | ||
set -e -x | ||
mkdir android_test | ||
cd android_test | ||
cp -av $(Build.SourcesDirectory)/java/src/test/android ./ | ||
cd ./android | ||
mkdir -p app/libs | ||
cp $(Build.BinariesDirectory)/final-android-aar/onnxruntime-mobile-$(OnnxRuntimeVersion).aar app/libs/onnxruntime-mobile.aar | ||
$(Build.SourcesDirectory)/java/gradlew --no-daemon clean connectedDebugAndroidTest | ||
displayName: Run E2E test for Android | ||
workingDirectory: $(Build.BinariesDirectory) | ||
- script: | | ||
python3 $(Build.SourcesDirectory)/tools/python/run_android_emulator.py \ | ||
--android-sdk-root ${ANDROID_SDK_ROOT} \ | ||
--stop \ | ||
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid | ||
displayName: Stop Android emulator | ||
condition: always() | ||
- template: component-governance-component-detection-steps.yml | ||
parameters : | ||
condition : 'succeeded' | ||
|
||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 | ||
displayName: 'Clean Agent Directories' | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters