Dump more info to try and figure out why the wrong emulator is running. #22
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
name: "Android x64 Build" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- rel-* | |
- skottmckay/* | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1" | |
ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" | |
ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" | |
# set gradle opt to try and avoid Connection Reset error when gradlew is downloading | |
# https://services.gradle.org/distributions/gradle-8.6-bin.zip. would be nicer if we didn't have to download | |
# when building though. maybe the gradle caching in setup-java will help with that once it successfully downloads. | |
# Params from https://github.com/actions/runner-images/issues/2715#issuecomment-797388909 | |
GRADLE_OPTS: "-Dorg.gradle.internal.http.connectionTimeout=60000 -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.network.retry.max.attempts=6 -Dorg.gradle.internal.network.retry.initial.backOff=2000" | |
jobs: | |
android_x64: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout OnnxRuntime GenAI repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
# not sure what's required here or how helpful it is. | |
# based on https://github.com/actions/setup-java?tab=readme-ov-file#caching-gradle-dependencies | |
# cache-dependency-path: | | |
# 'src/java/build-android.gradle' | |
# 'src/java/gradle/wrapper/gradle-wrapper.properties' | |
# 'src/java/src/test/android/build.gradle' | |
# 'src/java/src/test/android/app/build.gradle' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: '8.6' | |
# expecting Android SDK and JDK to be pre-installed | |
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md | |
- name: Check pre-installed requirements | |
run: | | |
set -e -x | |
echo "JAVA_HOME=$JAVA_HOME" | |
echo "JAVA_HOME_11_X64=$JAVA_HOME_11_X64" | |
echo "JAVA_HOME_11_arm64=$JAVA_HOME_11_arm64" | |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" | |
echo "ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" | |
ls -l $ANDROID_HOME/ndk | |
# - name: Install jq | |
# run: | | |
# sudo apt-get install jq | |
# - uses: actions/setup-dotnet@v4 | |
# with: | |
# dotnet-version: '8.0.x' | |
- name: Checkout OnnxRuntime GenAI repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get the Latest OnnxRuntime Nightly Version | |
run: | | |
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion') | |
echo "$ORT_NIGHTLY_VERSION" | |
echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV | |
- name: Download OnnxRuntime Nightly | |
run: | | |
nuget install ${{ env.ORT_PACKAGE_NAME }} -version ${{ env.ORT_NIGHTLY_VERSION }} -x | |
# unzip microsoft.ml.onnxruntime/${{ env.ORT_NIGHTLY_VERSION }}/runtimes/android/native/onnxruntime.aar -d ort | |
- name: Extract ONNX Runtime AAR | |
run: | | |
set -e -x | |
unzip ${{ env.ORT_PACKAGE_NAME }}/runtimes/android/native/onnxruntime.aar -d ort | |
ls -lR ort | |
- name: Create Android build | |
run: | | |
set -e -x | |
rm -rf build | |
./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=arm64-v8a --parallel --build_java --update | |
- name: Run Android build | |
run: | | |
set -e -x | |
./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=arm64-v8a --parallel --build_java --build | |
- name: Dump emulator info | |
run: | | |
set -e -x | |
/Users/runner/Library/Android/sdk/emulator/emulator --help | |
- name: Run Android tests | |
run: | | |
set -e -x | |
./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=arm64-v8a --parallel --build_java --android_run_emulator --test |