-
Notifications
You must be signed in to change notification settings - Fork 17
173 lines (160 loc) · 5.93 KB
/
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Sara Build + Test
on:
push:
pull_request:
release:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC",
os: windows-latest,
artifact: "windows_msvc.7z",
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
archiver: "7z a",
generators: "Visual Studio 16 2019"
}
- {
name: "Ubuntu Latest GCC",
os: ubuntu-latest,
artifact: "ubuntu_gcc.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja"
}
- {
name: "macOS Latest Clang",
os: macos-latest,
artifact: "macos_clang.7z",
build_type: "Release",
cc: "clang",
cxx: "clang++",
archiver: "7za a",
generators: "Ninja"
}
steps:
- uses: actions/checkout@v2
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Save ccache cache files
uses: actions/[email protected]
with:
path: .ccache
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
restore-keys: |
${ { matrix.config.name } }-ccache-
- name: Install dependencies on Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
run: |
# Now add the additional APT repositories:
#
# CMake.
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
# Vulkan SDK.
sudo wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list
# CLBlast.
sudo add-apt-repository ppa:cnugteren/clblast
# Update the packages list again.
sudo apt-get update -y -qq
# For the documentation.
sudo apt-get install -y -qq doxygen graphviz
# All the packages to compile the C++ codebase.
sudo apt-get install -y -qq \
build-essential \
ccache \
cmake \
cppcheck \
git \
lcov \
libboost-all-dev \
libclblast-dev \
libhdf5-dev \
libjpeg-dev \
libpng-dev \
libtiff5-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libglew-dev \
libglfw3-dev \
ocl-icd-opencl-dev \
opencl-headers \
libpocl-dev \
libceres-dev \
qtbase5-dev \
vulkan-sdk
# Install the GStreamer SDK.
sudo apt-get install -y -qq \
libgstreamer1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gstreamer1.0-doc \
gstreamer1.0-tools \
gstreamer1.0-x \
gstreamer1.0-alsa \
gstreamer1.0-gl \
gstreamer1.0-gtk3 \
gstreamer1.0-qt5 \
gstreamer1.0-pulseaudio
# Python dependencies
sudo apt-get install -y -qq python3-dev
# Setup for GUI testing.
sudo apt-get install -y xvfb
Xvfb :1 -noreset 1>/dev/null 2>&1 &
export DISPLAY=:1
# Coveralls for code coverage
sudo apt install rubygems
sudo gem install bundler
bundle install
- name: Build and test on Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
run: |
# 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
cmake --build . -j$(nproc)
# Create deb package.
cmake --build . --target package -j$(nproc)
# Run tests.
DISPLAY=:1 ctest \
-j$(nproc) \
--output-on-failure \
--exclude-regex "test_core_ipc_cond1|shakti_test_*"
# Run coverage (disabled for now).
#- make -j$(nproc) coverage
- name: Send code coverage to Coveralls
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
run: |
cd /home/runner/work/sara/sara
lcov --compat-libtool --directory build --base-directory=cpp/src --capture --output-file=coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --remove coverage.info '/home/runner/work/sara/sara/cpp/third-party/*' --output-file coverage.info
lcov --remove coverage.info '/home/runner/work/sara/sara/cpp/test/*' --output-file coverage.info
lcov --remove coverage.info '/home/runner/work/sara/sara/build/*' --output-file coverage.info
coveralls-lcov coverage.info