Skip to content

Commit

Permalink
CI: modify android.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Feb 23, 2024
1 parent da6cd3b commit 08a625d
Showing 1 changed file with 53 additions and 45 deletions.
98 changes: 53 additions & 45 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
include:
- BUILD_TYPE: Release
qt_arch: android_arm64_v8a
VCPKG_TARGET_TRIPLET: arm-android
VCPKG_DEFAULT_TRIPLET: arm-android
ENABLE_DOWNLOAD: ON

- BUILD_TYPE: Release
qt_arch: android_armv7
VCPKG_TARGET_TRIPLET: arm-android
VCPKG_DEFAULT_TRIPLET: arm-android
ENABLE_DOWNLOAD_MODULE: OFF

- BUILD_TYPE: Release
qt_arch: android_x86_64
VCPKG_TARGET_TRIPLET: x64-android
VCPKG_DEFAULT_TRIPLET: x64-android
ENABLE_DOWNLOAD: ON

runs-on: ubuntu-latest
Expand All @@ -39,8 +39,8 @@ jobs:
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.BUILD_TYPE}}
VCPKGGITCOMMITID: eb33d2f7583405fca184bcdf7fdd5828ec88ac05
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_HOST_TRIPLET: x64-linux
VCPKG_DEFAULT_TRIPLET: ${{matrix.VCPKG_DEFAULT_TRIPLET}}
VCPKG_DEFAULT_HOST_TRIPLET: x64-linux
ANDROID_PLATFORM: android-23
ANDROID_NATIVE_API_LEVEL: 23
STOREPASS: ${{secrets.STOREPASS}}
Expand All @@ -64,6 +64,11 @@ jobs:
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
cmake -E make_directory ${{github.workspace}}/build
echo "ANDROID_NDK_ROOT:${ANDROID_NDK_ROOT}"
echo "ANDROID_NDK_HOME:${ANDROID_NDK_HOME}"
echo "ANDROID_NDK_LATEST_HOME:${ANDROID_NDK_LATEST_HOME}"
echo "ANDROID_HOME:${ANDROID_HOME}"
echo "ANDROID_NDK:${ANDROID_NDK}"
- name: Cache installed
uses: actions/cache@v2
Expand All @@ -82,40 +87,6 @@ jobs:
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/

- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
version: '${{matrix.qt_version}}'
#host: 'linux'
target: 'desktop'
arch: 'gcc_64'
set-env: false
cache: true
cache-key-prefix: cached_qt

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
with:
# Directory to install Qt
dir: '${{env.TOOSL_DIR}}/qt' # optional
# Version of Qt to install
version: '${{matrix.qt_version}}'
# Host platform
#host: linux # optional
# Target platform for build
target: 'android' # optional, default is desktop
# Architecture for Windows/Android
arch: '${{matrix.qt_arch}}' # optional
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: cached_qt

- name: modify qt-cmake
run: |
sudo chmod 777 ${Qt6_DIR}/bin/qt-cmake
- name: build SeetaFace2
working-directory: ${{env.SOURCE_DIR}}
run: |
Expand All @@ -124,11 +95,12 @@ jobs:
cd SeetaFace2
cmake -E make_directory build
cd build
${Qt6_DIR}/bin/qt-cmake .. \
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_CHAINLbuildOAD_TOOLCHAIN_FILE=${Qt6_DIR}/lib/cmake/Qt6/qt.toolchain.cmake \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_DEFAULT_TRIPLET}} \
-DANDROID_ABI=${{matrix.ANDROID_ABI}} \
-DANDROID_PLATFORM=${{matrix.ANDROID_PLATFORM}} \
-DBUILD_EXAMPLE=OFF
Expand All @@ -144,18 +116,53 @@ jobs:
cd libfacedetection
cmake -E make_directory build
cd build
${Qt6_DIR}/bin/qt-cmake .. \
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_CHAINLbuildOAD_TOOLCHAIN_FILE=${Qt6_DIR}/lib/cmake/Qt6/qt.toolchain.cmake \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_DEFAULT_TRIPLET}} \
-DANDROID_ABI=${{matrix.ANDROID_ABI}} \
-DANDROID_PLATFORM=${{matrix.ANDROID_PLATFORM}} \
-DBUILD_SHARED_LIBS=ON
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
version: '${{matrix.qt_version}}'
#host: 'linux'
target: 'desktop'
arch: 'gcc_64'
set-env: false
cache: true
cache-key-prefix: cached_qt

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
with:
# Directory to install Qt
dir: '${{env.TOOSL_DIR}}/qt' # optional
# Version of Qt to install
version: '${{matrix.qt_version}}'
# Host platform
#host: linux # optional
# Target platform for build
target: 'android' # optional, default is desktop
# Architecture for Windows/Android
arch: '${{matrix.qt_arch}}' # optional
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: cached_qt

- name: modify qt-cmake
run: |
sudo chmod 777 ${Qt6_DIR}/bin/qt-cmake
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
Expand All @@ -175,6 +182,7 @@ jobs:
-DCMARK_TESTS=OFF \
-DCMARK_STATIC=ON \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
-DQT_HOST_PATH=${Qt6_DIR}/../gcc_64 \
-DANDROID_PLATFORM=${{env.ANDROID_PLATFORM}} \
-DANDROID_NATIVE_API_LEVEL=${{env.ANDROID_NATIVE_API_LEVEL}} \
Expand All @@ -185,8 +193,8 @@ jobs:
-DVCPKG_VERBOSE=ON \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_CHAINLbuildOAD_TOOLCHAIN_FILE=${Qt6_DIR}/lib/cmake/Qt6/qt.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${Qt6_DIR}/lib/cmake/Qt6/qt.toolchain.cmake \
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_DEFAULT_TRIPLET}} \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DVCPKG_APPLOCAL_DEPS=ON \
-DINSTALL_QT=ON
Expand Down

0 comments on commit 08a625d

Please sign in to comment.