onnxruntime/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml
Edward Chen 981893c318
Remove deprecated "mobile" packages (#20941)
# Description

This PR removes the building of the ORT "mobile" packages and much of the associated infrastructure which is no longer needed.

Not removed yet - tools/ci_build/github/android/mobile_package.required_operators.config and the helper scripts that depend on it.

# Motivation and Context

The mobile packages were deprecated in 1.18. Users should use the full packages (Android - onnxruntime-android, iOS - onnxruntime-c/onnxruntime-objc) instead or do a custom build.
2024-06-07 16:20:32 -05:00

93 lines
2.6 KiB
YAML

parameters:
- name: artifactName
displayName: Artifact Name
type: string
default: ''
- name: job_name_suffix
displayName: job name
type: string
default: ''
- name: packageName
displayName: Package Name
type: string
default: 'onnxruntime-android'
jobs:
- job: Final_AAR_Testing_Android_${{ parameters.job_name_suffix }}
workspace:
clean: all
pool:
# We need macOS-12 to run the Android emulator for now.
# https://github.com/actions/runner-images/issues/7671
vmImage: 'macOS-12'
variables:
- name: runCodesignValidationInjection
value: false
timeoutInMinutes: 90
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
- template: install-appcenter.yml
- template: use-android-emulator.yml
parameters:
create: true
start: true
- 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-android.aar
$(Build.SourcesDirectory)/java/gradlew --no-daemon clean connectedDebugAndroidTest --stacktrace
displayName: Run E2E test using Emulator
workingDirectory: $(Build.BinariesDirectory)
- template: use-android-emulator.yml
parameters:
stop: true
- 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)
- template: component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()