Skip to content

Commit bc58324

Browse files
authored
Update android-build.yml
1 parent ce8083a commit bc58324

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

.github/workflows/android-build.yml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- AE
6+
- AE
77
- rel-*
88
pull_request:
99

@@ -15,15 +15,10 @@ env:
1515
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"
1616
ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime"
1717
ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json"
18-
# ANDROID_ABI: "arm64-v8a"
1918
ANDROID_ABI: "x86_64"
2019

2120
jobs:
2221
android_x64:
23-
# Note: linux is the only good option for the Android emulator currently.
24-
# it doesn't work on macos-14.
25-
# HVF error: HV_UNSUPPORTED
26-
# it works on macos-13 but with macos-15 being released soon that isn't a long term solution.
2722
runs-on: ubuntu-latest
2823

2924
steps:
@@ -62,11 +57,6 @@ jobs:
6257
with:
6358
dotnet-version: '8.0.x'
6459

65-
- name: Checkout OnnxRuntime GenAI repo
66-
uses: actions/checkout@v4
67-
with:
68-
submodules: true
69-
7060
- name: Get the Latest OnnxRuntime Nightly Version
7161
run: |
7262
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion')
@@ -103,29 +93,34 @@ jobs:
10393
sudo udevadm control --reload-rules
10494
sudo udevadm trigger --name-match=kvm
10595
106-
# - name: Run Android tests
107-
# run: |
108-
# set -e -x
109-
# ./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=${{ env.ANDROID_ABI }} --parallel --build_java --android_run_emulator --test
96+
# Install Android SDK command line tools
97+
- name: Install Android SDK command line tools
98+
run: |
99+
sudo apt-get update -y
100+
sudo apt-get install -y wget unzip
101+
wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
102+
unzip commandlinetools-linux-6858069_latest.zip -d $HOME/android-sdk
103+
sudo mv $HOME/android-sdk/cmdline-tools $HOME/android-sdk/cmdline-tools-latest
104+
echo "export ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV
105+
echo "export ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV
106+
echo "export PATH=\$PATH:\$ANDROID_HOME/cmdline-tools/latest/bin" >> $GITHUB_ENV
107+
108+
# Ensure Android SDK tools are installed
109+
- name: Installing required Android SDK components...
110+
run: |
111+
sdkmanager --update
112+
sdkmanager "platform-tools" "emulator" "system-images;android-27;default;x86_64"
110113
114+
# Run Android tests with the emulator
111115
- name: Run Android tests
112116
run: |
113117
set -e -x
114118
115-
# Ensure Android SDK tools are installed
116-
echo "Installing required Android SDK components..."
117-
yes | sdkmanager "platform-tools" "emulator" "system-images;android-27;default;x86_64"
118-
119-
# Set the ANDROID_HOME environment variable if not already set
120-
export ANDROID_HOME=/usr/local/lib/android/sdk
121-
export ANDROID_SDK_ROOT=$ANDROID_HOME
122-
123-
# Check if emulator is installed
124-
if [ ! -f "$ANDROID_HOME/emulator/emulator" ]; then
125-
echo "Emulator not found at $ANDROID_HOME/emulator/emulator. Exiting..."
126-
exit 1
127-
fi
128-
129-
# Run the build script with the appropriate flags
130-
./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=${{ env.ANDROID_ABI }} --parallel --build_java --android_run_emulator --test
119+
# Check if emulator is installed
120+
if [ ! -f "$ANDROID_HOME/emulator/emulator" ]; then
121+
echo "Emulator not found at $ANDROID_HOME/emulator/emulator. Exiting..."
122+
exit 1
123+
fi
131124
125+
# Run the build script with the appropriate flags
126+
./build.sh --android --android_api=27 --android_ndk_path=${ANDROID_NDK_LATEST_HOME} --config=RelWithDebInfo --android_abi=${{ env.ANDROID_ABI }} --parallel --build_java --android_run_emulator --test

0 commit comments

Comments
 (0)