|
3 | 3 | workflow_dispatch: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - AE |
7 | | - - rel-* |
| 6 | + - AE |
| 7 | + - rel-* |
8 | 8 | pull_request: |
| 9 | + |
9 | 10 | concurrency: |
10 | 11 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
11 | 12 | cancel-in-progress: true |
| 13 | + |
12 | 14 | env: |
13 | 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" |
14 | 16 | ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime" |
15 | 17 | ORT_NIGHTLY_SOURCE: "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" |
16 | 18 | # ANDROID_ABI: "arm64-v8a" |
17 | 19 | ANDROID_ABI: "x86_64" |
| 20 | + |
18 | 21 | jobs: |
19 | 22 | android_x64: |
20 | 23 | # Note: linux is the only good option for the Android emulator currently. |
21 | 24 | # it doesn't work on macos-14. |
22 | 25 | # HVF error: HV_UNSUPPORTED |
23 | 26 | # it works on macos-13 but with macos-15 being released soon that isn't a long term solution. |
24 | 27 | runs-on: ubuntu-latest |
| 28 | + |
25 | 29 | steps: |
26 | 30 | - name: Checkout OnnxRuntime GenAI repo |
27 | 31 | uses: actions/checkout@v4 |
|
69 | 73 | echo "$ORT_NIGHTLY_VERSION" |
70 | 74 | echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV |
71 | 75 |
|
72 | | - # have to create a dummy project to use `add package` |
| 76 | + # Have to create a dummy project to use `add package` |
73 | 77 | - name: Download OnnxRuntime Nightly |
74 | 78 | run: | |
75 | 79 | dotnet new console |
@@ -99,7 +103,29 @@ jobs: |
99 | 103 | sudo udevadm control --reload-rules |
100 | 104 | sudo udevadm trigger --name-match=kvm |
101 | 105 |
|
| 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 |
| 110 | + |
102 | 111 | - name: Run Android tests |
103 | 112 | run: | |
104 | 113 | set -e -x |
105 | | - ./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 |
| 114 | +
|
| 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 |
| 131 | +
|
0 commit comments