Skip to content

Commit

Permalink
Revert "add missing build_java in Android testing stage. (#12187)"
Browse files Browse the repository at this point in the history
This reverts commit 4df4471.
  • Loading branch information
mszhanyi committed Jul 27, 2022
1 parent 7a1f8fb commit 7d9fa69
Showing 1 changed file with 25 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Known Limits
# 1. Anchors are not supported in GHA
# https://github.community/t/support-for-yaml-anchors/16128/90
# 2. today most cloud-based CI services are still lacking hardware acceleration support from the host VM,
# 2. today most cloud-based CI services are still lacking hardware acceleration support from the host VM,
# which is the no.1 blocker for running tests on modern Android Emulators (especially on recent API levels) on CI.

jobs:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
overWrite: true

- task: CopyFiles@2
displayName: Copy test data
displayName: Copy test data
inputs:
contents: 'build/**/testdata/**'
targetFolder: $(Build.ArtifactStagingDirectory)
Expand All @@ -84,9 +84,7 @@ jobs:
- task: CopyFiles@2
displayName: Copy test executables
inputs:
contents: |
build/Debug/*
build/Debug/java/androidtest/android/**
contents: 'build/Debug/*'
targetFolder: $(Build.ArtifactStagingDirectory)
overWrite: true

Expand Down Expand Up @@ -116,9 +114,6 @@ jobs:
artifact: 'CPUBuildOutput'
path: $(Build.SourcesDirectory)

- script: /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
displayName: Setup gradle wrapper to use gradle 6.8.3

- script: |
python3 tools/python/run_android_emulator.py \
--android-sdk-root ${ANDROID_SDK_ROOT} \
Expand All @@ -127,15 +122,6 @@ jobs:
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
displayName: Start Android emulator
# Start switching to jdk 11 after the Android Emulator is started
# since Android SDK manager requires java 8
- task: JavaToolInstaller@0
displayName: Use jdk 11
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- script: |
python3 tools/ci_build/build.py \
--android \
Expand All @@ -144,7 +130,6 @@ jobs:
--android_ndk_path $ANDROID_NDK_LATEST_HOME \
--android_abi=x86_64 \
--android_api=30 \
--build_java \
--test
displayName: CPU EP, Test on Android Emulator
Expand Down Expand Up @@ -234,17 +219,15 @@ jobs:
- task: CopyFiles@2
displayName: Copy Test Executables
inputs:
contents: |
build_nnapi/Debug/*
build_nnapi/Debug/java/androidtest/android/**
contents: 'build_nnapi/Debug/*'
targetFolder: $(Build.ArtifactStagingDirectory)
overWrite: true

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: NNAPIBuildOutput

- template: templates/clean-agent-build-directory-step.yml

- job: Test_NNAPI_EP
Expand Down Expand Up @@ -272,26 +255,14 @@ jobs:
inputs:
versionSpec: $(pythonVersion)

- script: /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
displayName: Setup gradle wrapper to use gradle 6.8.3

- script: |
python3 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
# Start switching to jdk 11 after the Android Emulator is started
# since Android SDK manager requires java 8
- task: JavaToolInstaller@0
displayName: Use jdk 11
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- script: |
python3 tools/ci_build/build.py \
--android \
Expand All @@ -300,7 +271,6 @@ jobs:
--android_ndk_path $ANDROID_NDK_LATEST_HOME \
--android_abi=x86_64 \
--android_api=29 \
--build_java \
--use_nnapi \
--test
displayName: NNAPI EP, Test, CodeCoverage on Android Emulator
Expand All @@ -317,6 +287,18 @@ jobs:
$(Build.SourcesDirectory)/protobuf_install
displayName: Build Host Protoc
- script: /bin/bash tools/ci_build/github/android/setup_gradle_wrapper.sh $(pwd)
displayName: Setup gradle wrapper to use gradle 6.8.3

# Start switching to jdk 11 after the Android Emulator is started
# since Android SDK manager requires java 8
- task: JavaToolInstaller@0
displayName: Use jdk 11
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd)
# Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator
displayName: Build Minimal ORT with NNAPI and run tests
Expand All @@ -328,7 +310,7 @@ jobs:
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
displayName: Stop Android emulator
condition: always()
- template: templates/clean-agent-build-directory-step.yml

# The below jobs only run on master build
Expand Down Expand Up @@ -364,7 +346,7 @@ jobs:
$(Build.BinariesDirectory)/protobuf \
$(Build.SourcesDirectory)/protobuf_install
displayName: Build Host Protoc
- script: |
python3 tools/python/run_android_emulator.py \
--android-sdk-root ${ANDROID_SDK_ROOT} \
Expand Down Expand Up @@ -398,7 +380,7 @@ jobs:
--build_java \
--code_coverage
displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator
- script: |
python3 -m pip install gcovr && \
python3 tools/ci_build/coverage.py \
Expand Down Expand Up @@ -426,9 +408,9 @@ jobs:
--emulator-pid-file $(Build.BinariesDirectory)/emulator.pid
displayName: Stop Android emulator
condition: always()
- template: templates/clean-agent-build-directory-step.yml

- job: Update_Dashboard
workspace:
clean: all
Expand All @@ -437,7 +419,7 @@ jobs:
value: true
pool: 'Linux-CPU-2019'
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
dependsOn:
dependsOn:
- Test_CPU_EP
- NNAPI_EP_MASTER
steps:
Expand All @@ -455,5 +437,5 @@ jobs:
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
arguments: '"$(Build.BinariesDirectory)/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi'
workingDirectory: '$(Build.BinariesDirectory)'

- template: templates/clean-agent-build-directory-step.yml

0 comments on commit 7d9fa69

Please sign in to comment.