Repository navigation
204 lines (186 loc) · 7.11 KB
/
Copy pathci.yml
File metadata and controls
204 lines (186 loc) · 7.11 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: CI
on:
push:
pull_request:
branches: [ "main" ]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1G
jobs:
build-and-test:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: gcc-14-normal
cc: gcc-14
cxx: g++-14
build_type: Release
sanitizer: normal
warnings_as_errors: OFF
cmake_flags: ""
- name: gcc-16-normal
cc: gcc-16
cxx: g++-16
build_type: Release
sanitizer: normal
warnings_as_errors: ON
cmake_flags: -DCMAKE_CXX_FLAGS=-Wno-maybe-uninitialized
- name: clang-23-asan
cc: clang-23
cxx: clang++-23
build_type: RelWithDebInfo
sanitizer: asan
warnings_as_errors: ON
cmake_flags: -DALP_ENABLE_ADDRESS_SANITIZER=ON
- name: clang-23-tsan
cc: clang-23
cxx: clang++-23
build_type: RelWithDebInfo
sanitizer: tsan
warnings_as_errors: ON
cmake_flags: -DALP_ENABLE_THREAD_SANITIZER=ON
- name: clang-23-unity
cc: clang-23
cxx: clang++-23
build_type: Release
sanitizer: normal
warnings_as_errors: ON
cmake_flags: -DALP_ENABLE_UNITY_BUILD=ON
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ccache \
extra-cmake-modules \
libcurl4-openssl-dev \
libegl1-mesa-dev \
libgl1-mesa-dev \
libglm-dev \
libgmp-dev \
libjpeg-dev \
libmpfr-dev \
libpng-dev \
libsqlite3-dev \
libtbb-dev \
libtiff-dev \
libwayland-bin \
libwayland-dev \
libxkbcommon-dev \
nasm \
ninja-build \
pkg-config \
sqlite3 \
wayland-protocols \
xorg-dev \
zlib1g-dev
- name: Install LLVM 23
if: matrix.cxx == 'clang++-23'
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm-23.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-23 lld-23 llvm-23 libclang-rt-23-dev
- name: Install GCC ${{ matrix.cxx }}
if: matrix.cxx == 'g++-16'
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${{ matrix.cc }} ${{ matrix.cxx }}
- name: Restore installed CMake dependencies
id: cmake_dependency_cache
uses: actions/cache/restore@v6
with:
path: |
build/alp_external/boost
build/alp_external/proj
build/alp_external/gdal
build/alp_external/cgal
build/alp_external/opencv
key: ${{ runner.os }}-alp-installs-${{ matrix.name }}-${{ matrix.build_type }}-${{ matrix.sanitizer }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: |
${{ runner.os }}-alp-installs-${{ matrix.name }}-${{ matrix.build_type }}-${{ matrix.sanitizer }}-
- name: Restore ccache
id: ccache_cache
uses: actions/cache/restore@v6
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.name }}-${{ matrix.sanitizer }}-${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.name }}-${{ matrix.sanitizer }}-${{ github.ref_name }}-
${{ runner.os }}-ccache-${{ matrix.name }}-${{ matrix.sanitizer }}-
- name: Configure ccache
run: |
ccache --max-size="${CCACHE_MAXSIZE}"
ccache --zero-stats
- name: Configure CMake
run: >
cmake
-S "${{ github.workspace }}"
-B "${{ github.workspace }}/build"
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER=${{ matrix.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DALP_WARNINGS_AS_ERRORS=${{ matrix.warnings_as_errors }}
-DALP_DEBUG_POISON_FILL=ON
${{ matrix.cmake_flags }}
- name: Save installed CMake dependencies
if: steps.cmake_dependency_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v6
with:
path: |
build/alp_external/boost
build/alp_external/proj
build/alp_external/gdal
build/alp_external/cgal
build/alp_external/opencv
key: ${{ runner.os }}-alp-installs-${{ matrix.name }}-${{ matrix.build_type }}-${{ matrix.sanitizer }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'cmake/*.cmake') }}
- name: Build all targets
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build_type }} --parallel --target all
- name: ccache stats
if: always()
run: ccache --show-stats
- name: Save ccache
if: always()
uses: actions/cache/save@v6
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.name }}-${{ matrix.sanitizer }}-${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_attempt }}
- name: Cache unit test data
id: terrain_builder_unittest_data
uses: actions/cache@v6
with:
path: unittests/data
key: terrain-builder-unittest-data-v1
- name: Download unit test data
if: steps.terrain_builder_unittest_data.outputs.cache-hit != 'true'
run: wget -qO- https://gataki.cg.tuwien.ac.at/raw/terrain_builder_unittest_data.tar.gz | tar xz -C unittests
- name: Run unit tests
working-directory: ${{ github.workspace }}/build
run: |
export PROJ_DATA="${{ github.workspace }}/build/alp_external/proj/share/proj"
export PROJ_LIB="${PROJ_DATA}"
export GDAL_DATA="${{ github.workspace }}/build/alp_external/gdal/share/gdal"
if [[ "${{ matrix.sanitizer }}" == "asan" ]]; then
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-23
export ASAN_OPTIONS="detect_leaks=1:halt_on_error=1"
export UBSAN_OPTIONS="halt_on_error=1:print_stacktrace=1:suppressions=${{ github.workspace }}/misc/suppression/ubsan.txt"
fi
if [[ "${{ matrix.sanitizer }}" == "tsan" ]]; then
export TSAN_OPTIONS="suppressions=${{ github.workspace }}/misc/suppression/tsan.txt"
fi
status=0
./unittests/unittests_terrainlib "~mesh::clip_on_bounds benchmark" || status=$?
./unittests/unittests_sfbuilder || status=$?
./unittests/unittests_dagbuilder || status=$?
./unittests/unittests_sfmerger || status=$?
exit $status