Merge pull request #218 from alicevision/dev/fixes #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
# branches: | |
# - master | |
# - develop | |
# Skip jobs when only documentation files are changed | |
# paths-ignore: | |
# - '**.md' | |
# - '**.rst' | |
# - 'docs/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- 'docs/**' | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
container: [ "alicevision/cctag-deps:cuda11.8.0-ubuntu20.04", "alicevision/cctag-deps:cuda12.1.0-ubuntu22.04" ] | |
build_type: [ "Release", "Debug" ] | |
container: | |
image: ${{ matrix.container }} | |
env: | |
DEPS_INSTALL_DIR: /opt/ | |
BUILD_TYPE: ${{ matrix.build_type }} | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Prepare File Tree | |
run: | | |
mkdir ./build | |
mkdir ./build_as_3rdparty | |
mkdir ../cctag_install | |
- name: Configure CMake | |
working-directory: ./build | |
run: | | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | |
-DBUILD_SHARED_LIBS:BOOL=ON \ | |
-DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \ | |
-DCMAKE_INSTALL_PREFIX:PATH=$PWD/../../cctag_install \ | |
-DWITH_CUDA:BOOL=ON | |
- name: Build | |
working-directory: ./build | |
run: | | |
make -j$(nproc) install | |
- name: Unit Tests | |
working-directory: ./build | |
run: | | |
export LD_LIBRARY_PATH=${DEPS_INSTALL_DIR}/lib:${LD_LIBRARY_PATH} | |
make test | |
- name: Build As Third Party | |
working-directory: ./build_as_3rdparty | |
run: | | |
cmake ../src/applications \ | |
-DBUILD_SHARED_LIBS:BOOL=ON \ | |
-DCMAKE_PREFIX_PATH:PATH="$PWD/../../cctag_install;${DEPS_INSTALL_DIR}" | |
make -j8 | |
build_windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
config: [ Debug, Release ] | |
env: | |
buildDir: '${{ github.workspace }}\build\' | |
vcpkgDir: '${{ github.workspace }}\..\e\vcpkg' | |
# commit for version 2023.11.20 | |
COMMIT_ID: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install latest CMake. | |
uses: lukka/get-cmake@latest | |
# Restore from cache the previously built ports. If a "cache miss" occurs, then vcpkg is bootstrapped. Since a the vcpkg.json is being used later on to install the packages when run-cmake runs, no packages are installed at this time and the input 'setupOnly:true' is mandatory. | |
- name: vcpkg - Setup dependencies | |
uses: lukka/run-vcpkg@v7 | |
with: | |
# Just install vcpkg for now, do not install any ports in this step yet. | |
setupOnly: false | |
# Location of the vcpkg submodule in the Git repository. | |
vcpkgDirectory: ${{ env.vcpkgDir }} | |
vcpkgGitCommitId: ${{ env.COMMIT_ID }} | |
vcpkgArguments: > | |
boost-accumulators | |
boost-algorithm boost-container | |
boost-date-time | |
boost-exception | |
boost-filesystem | |
boost-foreach | |
boost-iterator | |
boost-lexical-cast | |
boost-math | |
boost-mpl | |
boost-multi-array | |
boost-ptr-container | |
boost-program-options | |
boost-serialization | |
boost-spirit | |
boost-static-assert | |
boost-stacktrace | |
boost-test | |
boost-thread | |
boost-throw-exception | |
boost-timer | |
boost-type-traits | |
boost-unordered | |
opencv | |
tbb | |
eigen3 | |
vcpkgTriplet: x64-windows | |
# doNotCache: true | |
# This is used to unbreak cached artifacts if for some reason dependencies fail to build, | |
# the action does not notice it and saves broken artifacts. | |
appendedCacheKey: cache007 | |
- name: vcpkg - Display installed packages | |
run: | |
${{ env.vcpkgDir }}\vcpkg.exe list | |
- name: Build | |
uses: lukka/run-cmake@v3 | |
with: | |
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | |
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' | |
buildDirectory: ${{ env.buildDir }} | |
# cmakeGenerator: VS16Win64 | |
cmakeAppendedArgs: -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DVCPKG_TARGET_TRIPLET=x64-windows -A x64 -T host=x64 -DCCTAG_WITH_CUDA:BOOL=OFF | |
# This input tells run-cmake to consume the vcpkg.cmake toolchain file set by run-vcpkg. | |
cmakeBuildType: ${{ matrix.config }} | |
useVcpkgToolchainFile: true | |
buildWithCMake: true | |
buildWithCMakeArgs: -j1 --config ${{ matrix.config }} |