Skip to content

Commit

Permalink
CI: modify ci
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Feb 23, 2024
1 parent 412da1e commit f1faed3
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 222 deletions.
113 changes: 71 additions & 42 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ jobs:
matrix:
BUILD_TYPE: [Release]
qt_arch: [android_arm64_v8a, android_armv7, android_x86_64]
qt_version: [6.6.1]
qt_version: [6.6.2]
include:
- BUILD_TYPE: Release
qt_arch: android_arm64_v8a
VCPKG_TARGET_TRIPLET: arm-android
ENABLE_DOWNLOAD: ON

- BUILD_TYPE: Release
qt_arch: android_armv7
VCPKG_TARGET_TRIPLET: arm-android

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

runs-on: ubuntu-latest

Expand All @@ -35,11 +37,14 @@ jobs:
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.BUILD_TYPE}}
FaceRecognizer_VERSION: v0.0.4
VCPKGGITCOMMITID: eb33d2f7583405fca184bcdf7fdd5828ec88ac05
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_HOST_TRIPLET: x64-linux
ANDROID_PLATFORM: android-23
ANDROID_NATIVE_API_LEVEL: 23
qt_modules: 'qtimageformats qtmultimedia qtscxml'
STOREPASS: ${{secrets.STOREPASS}}
qt_modules: 'qtwebchannel qtwebsockets qtwebview qtimageformats qtmultimedia qtscxml qt5compat'
FaceRecognizer_VERSION: v0.0.4

# Map the job outputs to step outputs
outputs:
Expand All @@ -59,21 +64,21 @@ jobs:
cmake -E make_directory ${{github.workspace}}/build
- name: Cache installed
#if: false
uses: actions/cache@v2
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: cache-installed-android-qt${{matrix.qt_version}}-${{matrix.VCPKG_TARGET_TRIPLET}}-${{matrix.BUILD_TYPE}}
key: install_android_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}

- name: Cache Qt
#if: false
id: cache-qt
uses: actions/cache@v1 # not v2!
- name: run-vcpkg
uses: lukka/run-vcpkg@v11
with:
path: ${{env.TOOSL_DIR}}/qt
key: qt${{matrix.qt_version}}_${{matrix.qt_arch}}
# Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port.
#setupOnly: # optional
#vcpkgGitURL: https://github.com/KangLin/vcpkg.git
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/

- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
Expand All @@ -84,7 +89,8 @@ jobs:
target: 'desktop'
arch: 'gcc_64'
set-env: false
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false
cache: true
cache-key-prefix: cached_qt

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
Expand All @@ -101,32 +107,51 @@ jobs:
arch: '${{matrix.qt_arch}}' # optional
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cached: '${{ steps.cache-qt.outputs.cache-hit }}' # optional, default is false

# - name: run-vcpkg
# uses: lukka/[email protected]
# with:
# # Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port.
# #setupOnly: # optional
# #vcpkgGitURL: https://github.com/KangLin/vcpkg.git
# vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
# vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
# # Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# # compute its hash and append this to the computed cache's key.
# appendedCacheKey: android_${{matrix.os}}-qt${{matrix.qt_version}}-${{matrix.VCPKG_TARGET_TRIPLET}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}
# additionalCachedPaths: $VCPKG_ROOT/installed
# vcpkgTriplet: '${{ matrix.VCPKG_TARGET_TRIPLET }}'
# vcpkgArguments: 'openssl ffmpeg opencv opencv[contrib] dlib ncnn'

- name: run vcpkg
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: |
if [ ! -d vcpkg ]; then
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout -b ${{env.VCPKGGITCOMMITID}} ${{env.VCPKGGITCOMMITID}}
./bootstrap-vcpkg.sh
./vcpkg install --triplet=${{matrix.VCPKG_TARGET_TRIPLET}} openssl libyuv ffmpeg opencv[contrib]
if [ ! -f ${{env.INSTALL_DIR}}/lib/cmake/SeetaFaceDetectorConfig.cmake ]; then
git clone https://github.com/KangLin/SeetaFace2.git
cd SeetaFace2
cmake -E make_directory build
cd build
${Qt6_DIR}/bin/qt-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 \
-DANDROID_ABI=${{matrix.ANDROID_ABI}} \
-DANDROID_PLATFORM=${{matrix.ANDROID_PLATFORM}} \
-DBUILD_EXAMPLE=OFF
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
- name: build libfacedetection
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -f ${{env.INSTALL_DIR}}/lib/cmake/facedetection/facedetectionConfig.cmake ]; then
git clone https://github.com/ShiqiYu/libfacedetection.git
cd libfacedetection
cmake -E make_directory build
cd build
${Qt6_DIR}/bin/qt-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 \
-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: git clone RabbitCommon
Expand All @@ -138,7 +163,6 @@ jobs:
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
VCPKG_ROOT: ${{env.SOURCE_DIR}}/vcpkg
QT_ANDROID_KEYSTORE_PATH: ${{env.SOURCE_DIR}}/RabbitCommon/RabbitCommon.keystore
QT_ANDROID_KEYSTORE_ALIAS: rabbitcommon
QT_ANDROID_KEYSTORE_STORE_PASS: ${{secrets.STOREPASS}}
Expand All @@ -154,13 +178,18 @@ jobs:
-DANDROID_NATIVE_API_LEVEL=${{env.ANDROID_NATIVE_API_LEVEL}} \
-DQT_ANDROID_SIGN_APK=ON \
-DQT_ENABLE_VERBOSE_DEPLOYMENT=OFF \
-DQT_DIR=${Qt6_DIR} \
-DQt6LinguistTools_DIR=${Qt6_DIR}/../gcc_64/lib/cmake/Qt6LinguistTools \
-DVCPKG_VERBOSE=ON \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
cmake --build . --config ${{matrix.BUILD_TYPE}} --target all
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
-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 \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DVCPKG_APPLOCAL_DEPS=ON \
-DINSTALL_QT=ON
cmake --build . --config ${{matrix.BUILD_TYPE}} --target all
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
APK_FILE=`find . -name "android-*.apk"`
cp $APK_FILE FaceRecognizer_${{env.FaceRecognizer_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}.apk
7z a FaceRecognizer_${{env.FaceRecognizer_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}.zip install/*
Expand Down
53 changes: 28 additions & 25 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,30 @@ jobs:
matrix:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: [Release, Debug]
qt_version: [6.5.1, 5.15.2, 5.12.12]
qt_version: [6.6.2, 5.15.2, 5.12.12]
qt_arch: [clang_64]
VCPKG_TARGET_TRIPLET: [x64-osx]
include:
- qt_version: 6.5.1
qt_modules: qtscxml qtpositioning qt5compat qtwebchannel qtwebsockets
- qt_version: 6.6.2
qt_modules: qtscxml qtpositioning qt5compat qtwebchannel qtwebsockets qtmultimedia
ENABLE_DOWNLOAD: ON

- qt_version: 5.15.2
qt_modules: ""

- qt_version: 5.12.12
qt_modules: ""

runs-on: macos-latest

env:
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_macos
qt_modules: ${{matrix.qt_modules}}
FaceRecognizer_VERSION: v0.0.4
INSTALL_DIR: ${{github.workspace}}/.cache/install
qt_modules: qtwebengine ${{matrix.qt_modules}}
VCPKGGITCOMMITID: a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
artifact_name: build_macos
VCPKGGITCOMMITID: eb33d2f7583405fca184bcdf7fdd5828ec88ac05
FaceRecognizer_VERSION: v0.0.4

# Map the job outputs to step outputs
outputs:
Expand All @@ -62,23 +64,22 @@ jobs:
with:
path: |
${{env.INSTALL_DIR}}
key: Cache-macos-installed-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}
key: install_macos_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}

- name: Install application
run: |
brew install nasm
- name: run-vcpkg
uses: lukka/run-vcpkg@v7.4
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{runner.workspace}}/vcpkg/
# Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: vcpkg-macos-${{env.VCPKGGITCOMMITID}}
vcpkgTriplet: '${{matrix.triplet}}'
vcpkgArguments: 'openssl libyuv ffmpeg opencv opencv[contrib] dlib ncnn'


- name: run vcpkg
run: |
brew install nasm
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1 # not v2!
Expand All @@ -87,15 +88,14 @@ jobs:
key: qt${{matrix.qt_version}}-${{matrix.qt_arch}}

- name: Install Qt
# You may pin to the exact commit or the version.
# uses: jurplel/install-qt-action@a962fb91949c8e846a3e4a944d50e7ef5cc3a28a
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}} # optional, default is 5.15.2
modules: ${{env.qt_modules}} # optional. See: https://ddalcino.github.io/aqt-list-server/
dir: '${{env.TOOSL_DIR}}/qt' # optional
version: '${{matrix.qt_version}}' # optional, default is 5.15.2
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional
cache: true
cache-key-prefix: cached_qt

- name: build SeetaFace2
working-directory: ${{env.SOURCE_DIR}}
Expand All @@ -108,7 +108,8 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" \
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake"
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" \
-DBUILD_EXAMPLE=OFF
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
Expand Down Expand Up @@ -148,6 +149,8 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}\scripts\buildsystems\vcpkg.cmake" \
-DVCPKG_VERBOSE=ON \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DVCPKG_APPLOCAL_DEPS=ON \
-DINSTALL_QT=ON \
-DSeetaFace_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-DSeetaNet_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-DSeetaFaceDetector_DIR=${{env.INSTALL_DIR}}/lib/cmake \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jobs:
cd build
cmake .. -G"MinGW Makefiles" ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}"
-DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" ^
-DBUILD_EXAMPLE=OFF
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
)
Expand Down
Loading

0 comments on commit f1faed3

Please sign in to comment.