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 21, 2024
1 parent 412da1e commit 7042cf0
Show file tree
Hide file tree
Showing 13 changed files with 285 additions and 203 deletions.
98 changes: 59 additions & 39 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand All @@ -39,7 +39,7 @@ jobs:
VCPKGGITCOMMITID: eb33d2f7583405fca184bcdf7fdd5828ec88ac05
ANDROID_PLATFORM: android-23
ANDROID_NATIVE_API_LEVEL: 23
qt_modules: 'qtimageformats qtmultimedia qtscxml'
qt_modules: 'qtwebengine qtimageformats qtmultimedia qtscxml qt5compat'

# Map the job outputs to step outputs
outputs:
Expand All @@ -59,21 +59,61 @@ 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: build SeetaFace2
working-directory: ${{env.SOURCE_DIR}}
run: |
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
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=$ANDROID_NDK_HOME/build/cmake/android.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
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=$ANDROID_NDK_HOME/build/cmake/android.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: Install Qt of gcc_64
uses: jurplel/install-qt-action@v3
Expand All @@ -84,7 +124,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,33 +142,8 @@ 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
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]
fi
cache: true
cache-key-prefix: cached_qt

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand Down Expand Up @@ -158,7 +174,11 @@ jobs:
-DVCPKG_VERBOSE=ON \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
-DVCPKG_APPLOCAL_DEPS=ON \
-DINSTALL_QT=ON \
-DENABLE_DOWNLOAD=ON
cmake --build . --config ${{matrix.BUILD_TYPE}} --target all
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
APK_FILE=`find . -name "android-*.apk"`
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ 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]
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

- qt_version: 5.15.2
qt_modules: ""

- qt_version: 5.12.12
qt_modules: ""

runs-on: macos-latest

Expand All @@ -34,7 +32,7 @@ jobs:
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_macos
qt_modules: ${{matrix.qt_modules}}
qt_modules: qtwebengine ${{matrix.qt_modules}}
FaceRecognizer_VERSION: v0.0.4
artifact_name: build_macos
VCPKGGITCOMMITID: eb33d2f7583405fca184bcdf7fdd5828ec88ac05
Expand Down Expand Up @@ -62,23 +60,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 +84,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 +104,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,14 +145,17 @@ 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 \
-DSeetaFaceLandmarker_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-DSeetaFaceRecognizer_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-DSeetaFaceTracker_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-DSeetaQualityAssessor_DIR=${{env.INSTALL_DIR}}/lib/cmake \
-Dfacedetection_DIR=${{env.INSTALL_DIR}}/lib/cmake/facedetection
-Dfacedetection_DIR=${{env.INSTALL_DIR}}/lib/cmake/facedetection \
-DENABLE_DOWNLOAD=ON
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
7z a FaceRecognizer_${{env.FaceRecognizer_VERSION}}_macos_qt${{matrix.qt_version}}.zip ./install/*
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
43 changes: 21 additions & 22 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ jobs:
strategy:
matrix:
BUILD_TYPE: [Release, Debug]
qt_version: [6.6.1, 6.5.2, 5.15.2, 5.12.12]
qt_version: [6.6.2, 5.15.2, 5.12.12]
include:
- qt_version: 6.6.1
triplet: x64-windows
VCPKG_PLATFORM_TOOLSET: v142
qt_arch: win64_msvc2019_64
CMAKE_GENERATOR_PLATFORM: x64
qt_modules: qtscxml qtpositioning qtwebchannel qtwebsockets qtwebview qtmultimedia qt5compat

- qt_version: 6.5.2
- qt_version: 6.6.2
triplet: x64-windows
VCPKG_PLATFORM_TOOLSET: v142
qt_arch: win64_msvc2019_64
Expand Down Expand Up @@ -82,18 +75,19 @@ jobs:
with:
path: |
${{env.INSTALL_DIR}}
key: FaceRecognizer_msvc_cache-installed-${{matrix.os}}-vc${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.triplet}}-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}_2033_03_02
key: install_msvc_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}

- 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: cache-vcpkg-msvc-${{matrix.os}}-vc${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.triplet}}-qt${{matrix.qt_version}}-${{matrix.BUILD_TYPE}}-${{env.VCPKGGITCOMMITID}}
vcpkgTriplet: '${{matrix.triplet}}'
vcpkgArguments: 'openssl libyuv ffmpeg opencv opencv[contrib] dlib ncnn'

- name: run vcpkg
if: false
run: |
vcpkg install --VCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^
--x-feature=SeetaFace
- name: build SeetaFace2
working-directory: ${{env.SOURCE_DIR}}
Expand All @@ -108,7 +102,8 @@ jobs:
-T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^
-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
)
Expand Down Expand Up @@ -169,14 +164,17 @@ 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 ^
-DSeetaFaceLandmarker_DIR=${{env.INSTALL_DIR}}/lib/cmake ^
-DSeetaFaceRecognizer_DIR=${{env.INSTALL_DIR}}/lib/cmake ^
-DSeetaFaceTracker_DIR=${{env.INSTALL_DIR}}/lib/cmake ^
-DSeetaQualityAssessor_DIR=${{env.INSTALL_DIR}}/lib/cmake ^
-Dfacedetection_DIR=${{env.INSTALL_DIR}}/lib/cmake/facedetection
-Dfacedetection_DIR=${{env.INSTALL_DIR}}/lib/cmake/facedetection ^
-DENABLE_DOWNLOAD=ON
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
Expand All @@ -192,8 +190,8 @@ jobs:
makensis Install.nsi
copy /Y FaceRecognizer_${{env.FaceRecognizer_VERSION}}_Setup.exe FaceRecognizer_${{env.FaceRecognizer_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
- name: Update xml
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.qt_version == '6.6.1' }}
- name: Update configure file
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.qt_version == '6.6.2' }}
working-directory: ${{github.workspace}}\build
run: |
${{github.workspace}}\build\install\bin\FaceRecognizerApp.exe ^
Expand All @@ -205,13 +203,14 @@ jobs:
-m "${{env.FaceRecognizer_VERSION}}"
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.qt_version == '6.6.2' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}\build\FaceRecognizer_${{env.FaceRecognizer_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
${{github.workspace}}\build\update_windows.xml
${{github.workspace}}\build\update_windows.json
${{github.workspace}}\build\update_windows.json.xml
# - name: Upload To Github Release
# if: ${{ matrix.BUILD_TYPE == 'Release' && '5.12.12' == matrix.qt_version && startsWith(github.ref, 'refs/tags/') }}
Expand Down
Loading

0 comments on commit 7042cf0

Please sign in to comment.