Skip to content

Set gradle caching to see if that helps with SSL error #11

Set gradle caching to see if that helps with SSL error

Set gradle caching to see if that helps with SSL error #11

Workflow file for this run

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"
jobs:
android_x64:
runs-on: macos-latest
steps:
- name: Checkout OnnxRuntime GenAI repo
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Java 11
uses: actions/setup-java@v2
with:
java-version: '11'
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.gradle'
'src/java/**/gradle-wrapper.properties'
# 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=x86_64 --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=x86_64 --parallel --build_java --build
- 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=x86_64 --parallel --build_java --android_run_emulator --test