mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
- Update Gradle version used in most places from 6.8.3 to 8.0.1. Update Android Gradle Plugin version where applicable. Not updated in this change: React Native Android projects (under `js/react_native/`). That can be done later along with updating the React Native projects. - Add Gradle wrapper in `java/` to make it easier to consistently use a specific Gradle version.
97 lines
3.1 KiB
YAML
97 lines
3.1 KiB
YAML
parameters:
|
|
- name: artifactName
|
|
displayName: Artifact Name
|
|
type: string
|
|
default: ''
|
|
|
|
- name: job_name_suffix
|
|
displayName: job name
|
|
type: string
|
|
default: ''
|
|
|
|
- name: packageName
|
|
# now we can build onnxruntime-android or onnxruntime-mobile for Android, need specify it here
|
|
displayName: Package Name
|
|
type: string
|
|
default: 'onnxruntime-android'
|
|
|
|
jobs:
|
|
- job: Final_AAR_Testing_Android_${{ parameters.job_name_suffix }}
|
|
workspace:
|
|
clean: all
|
|
pool:
|
|
vmImage: 'macOS-11'
|
|
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'
|
|
|
|
- task: JavaToolInstaller@0
|
|
displayName: Use jdk 11
|
|
inputs:
|
|
versionSpec: '11'
|
|
jdkArchitectureOption: 'x64'
|
|
jdkSourceOption: 'PreInstalled'
|
|
|
|
- template: use-android-ndk.yml
|
|
|
|
- script: |
|
|
python3 $(Build.SourcesDirectory)/tools/python/run_android_emulator.py \
|
|
--android-sdk-root ${ANDROID_SDK_ROOT} \
|
|
--create-avd --system-image "system-images;android-31;default;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/${{parameters.packageName}}-$(OnnxRuntimeVersion).aar app/libs/onnxruntime-mobile.aar
|
|
$(Build.SourcesDirectory)/java/gradlew --no-daemon clean connectedDebugAndroidTest --stacktrace
|
|
displayName: Run E2E test using Emulator
|
|
workingDirectory: $(Build.BinariesDirectory)
|
|
|
|
- script: |
|
|
set -e -x
|
|
cd android_test/android
|
|
appcenter test run espresso \
|
|
--app "AI-Frameworks/ORT-Mobile-Android" \
|
|
--devices $(app_center_android_test_devices) \
|
|
--app-path ./app/build/outputs/apk/debug/app-debug.apk \
|
|
--test-series "master" \
|
|
--locale "en_US" \
|
|
--build-dir ./app/build/outputs/apk/androidTest/debug \
|
|
--token $(app_center_api_token)
|
|
displayName: Run E2E tests using App Center
|
|
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()
|