-
Notifications
You must be signed in to change notification settings - Fork 16
/
.gitlab-ci.yml
142 lines (127 loc) · 3.86 KB
/
.gitlab-ci.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
image: ubuntu:22.04
cache:
paths:
- .apt/
- ccache/
before_script:
# Configure APT caching
- echo $CI_PROJECT_DIR
- export APT_DIR=$CI_PROJECT_DIR/.apt
- export APT_STATE_LISTS=$APT_DIR/lists
- export APT_CACHE_ARCHIVES=$APT_DIR/archives
- printf "dir::state::lists ${APT_STATE_LISTS};\ndir::cache::archives ${APT_CACHE_ARCHIVES};\n" > /etc/apt/apt.conf
- mkdir -p "${APT_STATE_LISTS}/partial" && mkdir -p "${APT_CACHE_ARCHIVES}/partial"
# Setup ccache to speed up builds.
- mkdir -p ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
# Do this first.
- apt-get update -y -qq
# Install the prerequisite software to add APT packages.
- apt-get install -y -qq
apt-transport-https
ca-certificates
gnupg
software-properties-common
wget
# Now add the additional APT repositories:
#
# CMake.
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy-rc main' | tee -a /etc/apt/sources.list.d/kitware.list >/dev/null
# Vulkan SDK.
- wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc
- wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
# Intel TBB
# - echo "deb http://cz.archive.ubuntu.com/ubuntu eoan main universe" | tee -a /etc/apt/sources.list
# Update the packages list again.
- apt-get update -y -qq
# For the documentation.
- apt-get install -y -qq
doxygen
graphviz
# All the packages to compile the C++ codebase.
- apt-get install -y -qq
build-essential
ccache
cmake
cppcheck
git
lcov
libboost-all-dev
libhdf5-dev
libheif-dev
libjpeg-dev
libpng-dev
libtiff5-dev
libwebp-dev
libavcodec-dev
libavformat-dev
libavutil-dev
libclblast-dev
libswscale-dev
libglew-dev
libglfw3-dev
ocl-icd-opencl-dev
opencl-headers
libpocl-dev
libtbb-dev
libceres-dev
qtbase5-dev
vulkan-sdk
# Python dependencies (TODO).
- apt-get install -y -qq python3-dev
# Coveralls-lcov
- apt-get install -y -qq rubygems
- gem install bundler
- bundle install
# Setup for GUI testing.
- apt-get install -y xvfb
- Xvfb :1 -noreset 1>/dev/null 2>&1 &
- export DISPLAY=:1
# cppcheck:
# stage: build
# script:
# - cppcheck --enable=all --inconclusive --verbose cpp/src
build:
stage: build
script:
# Build Sara.
- mkdir build
- cd build
- cmake ..
-DCMAKE_BUILD_TYPE:STRING=Debug
-DSARA_BUILD_SHARED_LIBS:BOOL=ON
-DSARA_BUILD_VIDEOIO:BOOL=ON
-DSARA_BUILD_SAMPLES:BOOL=ON
-DSARA_BUILD_TESTS:BOOL=ON
- make -j$(nproc) VERBOSE=1
# Create deb package.
# - make package # Lack of space in the build machine ?
# Run tests.
- DISPLAY=:1 ctest
-j$(nproc)
--output-on-failure
--exclude-regex "test_graphics_*|test_visualization_*|test_core_ipc_cond1|test_videoio_video_writer|shakti_test_*|test_ransac_*"
# FIXME: I give up the code coverage... Will come back to it later.
# - make -j$(nproc) coverage
# - coveralls-lcov coverage.info --repo-token=$(cat .coveralls.gitlab.yml)
pages:
script:
# Configure the documentation build.
- mkdir build
- cd build
- cmake ..
-DSARA_BUILD_SHARED_LIBS:BOOL=ON
-DSARA_BUILD_VIDEOIO:BOOL=ON
- make -j$(nproc) doc
# Move the generated documentation in the right place.
- mv doc/html/ ../public/
artifacts:
paths:
- public
staging:
stage: deploy
trigger:
project: oddkiva/sara-book
branch: master