|
3 | 3 | workflow_dispatch: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - AE |
| 6 | + - AE |
7 | 7 | - rel-* |
8 | 8 | pull_request: |
9 | 9 |
|
|
15 | 15 | 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" |
16 | 16 | ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" |
17 | 17 | ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" |
18 | | - # ANDROID_ABI: "arm64-v8a" |
19 | 18 | ANDROID_ABI: "x86_64" |
20 | 19 |
|
21 | 20 | jobs: |
22 | 21 | 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. |
27 | 22 | runs-on: ubuntu-latest |
28 | 23 |
|
29 | 24 | steps: |
|
62 | 57 | with: |
63 | 58 | dotnet-version: '8.0.x' |
64 | 59 |
|
65 | | - - name: Checkout OnnxRuntime GenAI repo |
66 | | - uses: actions/checkout@v4 |
67 | | - with: |
68 | | - submodules: true |
69 | | - |
70 | 60 | - name: Get the Latest OnnxRuntime Nightly Version |
71 | 61 | run: | |
72 | 62 | ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion') |
@@ -103,29 +93,34 @@ jobs: |
103 | 93 | sudo udevadm control --reload-rules |
104 | 94 | sudo udevadm trigger --name-match=kvm |
105 | 95 |
|
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" |
110 | 113 |
|
| 114 | + # Run Android tests with the emulator |
111 | 115 | - name: Run Android tests |
112 | 116 | run: | |
113 | 117 | set -e -x |
114 | 118 |
|
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 |
131 | 124 |
|
| 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