|
| 1 | +name: Android ARM64 with vcpkg |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + paths-ignore: |
| 6 | + - '**/docs/**' |
| 7 | + - 'docs/**' |
| 8 | + - '**/**.md' |
| 9 | + - '**.md' |
| 10 | + - '**/layer_tests_summary/**' |
| 11 | + - '**/conformance/**' |
| 12 | + push: |
| 13 | + paths-ignore: |
| 14 | + - '**/docs/**' |
| 15 | + - 'docs/**' |
| 16 | + - '**/**.md' |
| 17 | + - '**.md' |
| 18 | + - '**/layer_tests_summary/**' |
| 19 | + - '**/conformance/**' |
| 20 | + branches: |
| 21 | + - master |
| 22 | + |
| 23 | +concurrency: |
| 24 | + # github.ref is not unique in post-commit |
| 25 | + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-android-arm64-vcpkg |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + Build: |
| 30 | + defaults: |
| 31 | + run: |
| 32 | + shell: bash |
| 33 | + runs-on: aks-linux-16-cores |
| 34 | + container: |
| 35 | + image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04 |
| 36 | + volumes: |
| 37 | + - /mount/caches:/mount/caches |
| 38 | + env: |
| 39 | + DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input |
| 40 | + CMAKE_GENERATOR: 'Ninja' |
| 41 | + CMAKE_CXX_COMPILER_LAUNCHER: ccache |
| 42 | + CMAKE_C_COMPILER_LAUNCHER: ccache |
| 43 | + OPENVINO_REPO: '/__w/openvino/openvino/openvino' |
| 44 | + VCPKG_ROOT: '/__w/openvino/openvino/vcpkg' |
| 45 | + BUILD_DIR: '/__w/openvino/openvino/build' |
| 46 | + INSTALL_DIR: '/__w/openvino/openvino/install' |
| 47 | + ANDROID_TOOLS: '/__w/openvino/openvino/android_tools' |
| 48 | + ANDROID_NDK_HOME: '/__w/openvino/openvino/android_tools/ndk-bundle' |
| 49 | + ANDROID_SDK_VERSION: 29 |
| 50 | + ANDROID_ABI_CONFIG: arm64-v8a |
| 51 | + CCACHE_DIR: '/mount/caches/ccache/android_arm64' |
| 52 | + CCACHE_TEMPDIR: '/__w/openvino/openvino/ccache_temp' |
| 53 | + CCACHE_MAXSIZE: 50G |
| 54 | + steps: |
| 55 | + - name: Install git |
| 56 | + run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates |
| 57 | + |
| 58 | + - name: Clone OpenVINO |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + path: 'openvino' |
| 62 | + |
| 63 | + - name: Init submodules for non vcpkg dependencies |
| 64 | + run: | |
| 65 | + pushd ${OPENVINO_REPO} |
| 66 | + git submodule update --init -- ${OPENVINO_REPO}/src/plugins |
| 67 | + git submodule update --init -- ${OPENVINO_REPO}/thirdparty/gtest |
| 68 | + git submodule update --init -- ${OPENVINO_REPO}/thirdparty/gflags |
| 69 | + git submodule update --init -- ${OPENVINO_REPO}/thirdparty/open_model_zoo |
| 70 | + popd |
| 71 | +
|
| 72 | + - name: Clone vcpkg |
| 73 | + uses: actions/checkout@v4 |
| 74 | + with: |
| 75 | + repository: 'microsoft/vcpkg' |
| 76 | + path: 'vcpkg' |
| 77 | + fetch-depth: '0' |
| 78 | + |
| 79 | + # |
| 80 | + # Dependencies |
| 81 | + # |
| 82 | + |
| 83 | + - name: Install dependencies |
| 84 | + run: | |
| 85 | + # generic dependencies |
| 86 | + apt --assume-yes install ccache scons ninja-build build-essential python3-pip |
| 87 | +
|
| 88 | + # vcpkg requires cmake 3.19 or later |
| 89 | + python3 -m pip install -U pip cmake |
| 90 | + # vcpkg's tool dependencies |
| 91 | + apt --assume-yes install curl zip unzip tar |
| 92 | + # vcpkg 'python3' port dependencies |
| 93 | + apt --assume-yes install autoconf libtool autoconf-archive |
| 94 | + # vcpkg tree of dependencies require extra packages |
| 95 | + apt --assume-yes install pkg-config linux-libc-dev |
| 96 | +
|
| 97 | + # Install Android SDK, NDK and Tools |
| 98 | + apt -y --no-install-recommends install unzip wget default-jdk |
| 99 | + wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip |
| 100 | + unzip commandlinetools-linux-7583922_latest.zip |
| 101 | + echo "yes" | ./cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_TOOLS} --install "ndk-bundle" "platform-tools" "platforms;android-${{ env.ANDROID_SDK_VERSION }}" |
| 102 | +
|
| 103 | + # |
| 104 | + # Build |
| 105 | + # |
| 106 | + |
| 107 | + - name: Build vcpkg |
| 108 | + run: | |
| 109 | + ${VCPKG_ROOT}/bootstrap-vcpkg.sh |
| 110 | + # patch vcpkg default toolchain to build only Release configuration |
| 111 | + echo "set(VCPKG_BUILD_TYPE release)" >> ${VCPKG_ROOT}/triplets/arm64-android.cmake |
| 112 | +
|
| 113 | + - name: CMake - configure |
| 114 | + run: | |
| 115 | + cmake \ |
| 116 | + -G '${{ env.CMAKE_GENERATOR }}' \ |
| 117 | + -DENABLE_INTEL_GPU=ON \ |
| 118 | + -DENABLE_TESTS=ON \ |
| 119 | + -DENABLE_SYSTEM_OPENCL=ON \ |
| 120 | + -DENABLE_SYSTEM_PROTOBUF=ON \ |
| 121 | + -DENABLE_SYSTEM_PUGIXML=ON \ |
| 122 | + -DENABLE_SYSTEM_SNAPPY=ON \ |
| 123 | + -DENABLE_SYSTEM_TBB=ON \ |
| 124 | + -DENABLE_SYSTEM_FLATBUFFERS=ON \ |
| 125 | + -DANDROID_ABI=${{ env.ANDROID_ABI_CONFIG }} \ |
| 126 | + -DANDROID_PLATFORM=${{ env.ANDROID_SDK_VERSION }} \ |
| 127 | + -DVCPKG_TARGET_TRIPLET=arm64-android \ |
| 128 | + -DVCPKG_HOST_TRIPLET=x64-linux-release \ |
| 129 | + -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \ |
| 130 | + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ |
| 131 | + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ |
| 132 | + -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \ |
| 133 | + -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \ |
| 134 | + -S ${OPENVINO_REPO} \ |
| 135 | + -B ${BUILD_DIR} |
| 136 | +
|
| 137 | + - name: Clean ccache stats |
| 138 | + run: ccache --zero-stats --show-config |
| 139 | + |
| 140 | + - name: Cmake - build |
| 141 | + run: cmake --build ${BUILD_DIR} --parallel |
| 142 | + |
| 143 | + - name: Show ccache stats |
| 144 | + run: ccache --show-stats |
0 commit comments