-
Notifications
You must be signed in to change notification settings - Fork 88
149 lines (134 loc) · 4.55 KB
/
continuous-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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-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: cache006
- 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=OFFgit git
# 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 }}