-
-
Notifications
You must be signed in to change notification settings - Fork 325
303 lines (280 loc) · 9.47 KB
/
qt-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
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
name: qt-ci
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "qt-**"
paths:
- CMakeLists.txt
- ".github/actions/qt5-build/**"
- ".github/actions/qt6-build/**"
- ".github/workflows/qt-ci.yml"
- "bin/**"
- "expression-test/**"
- "include/**"
- "metrics/**"
- "platform/default/**"
- "platform/qt/**"
- "render-test/**"
- "scripts/**"
- "src/**"
- "test/**"
- "vendor/**"
- ".gitmodules"
- "!**/*.md"
pull_request:
branches:
- "*"
paths:
- CMakeLists.txt
- ".github/actions/qt5-build/**"
- ".github/actions/qt6-build/**"
- ".github/workflows/qt-ci.yml"
- "bin/**"
- "expression-test/**"
- "include/**"
- "metrics/**"
- "platform/default/**"
- "platform/qt/**"
- "render-test/**"
- "scripts/**"
- "src/**"
- "test/**"
- "vendor/**"
- ".gitmodules"
- "!**/*.md"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
strategy:
matrix:
include:
- name: Linux
os: ubuntu-22.04
build_type: RelWithDebInfo
qt_version: 5.15.2
qt_target: desktop
compiler: ""
- name: Linux
os: ubuntu-22.04
build_type: RelWithDebInfo
qt_version: 6.5.3
qt_target: desktop
compiler: ""
- name: Linux_GCC13
os: ubuntu-22.04
build_type: RelWithDebInfo
qt_version: 6.5.3
qt_target: desktop
compiler: "gcc-13"
- name: macOS
os: macos-12
build_type: RelWithDebInfo
qt_version: 5.15.2
qt_target: desktop
deployment_target: 10.13
deployment_arch: "x86_64"
compiler: ""
- name: macOS
os: macos-12
build_type: RelWithDebInfo
qt_version: 6.5.3
qt_target: desktop
deployment_target: 11.0
deployment_arch: "x86_64;arm64"
compiler: ""
- name: macOS_LLVM17
os: macos-13
build_type: RelWithDebInfo
qt_version: 6.5.3
qt_target: desktop
deployment_target: 11.0
deployment_arch: "x86_64"
compiler: "llvm@17"
- name: win64_msvc2019
os: windows-2022
build_type: "RelWithDebInfo"
compiler_type: x64
compiler_version: 14.29
qt_version: 5.15.2
qt_target: desktop
qt_arch: win64_msvc2019_64
qt_tools: ""
- name: win64_msvc2019
os: windows-2022
build_type: "RelWithDebInfo"
compiler_type: x64
compiler_version: 14.29
qt_version: 6.5.3
qt_target: desktop
qt_arch: win64_msvc2019_64
qt_tools: ""
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: ${{ matrix.build_type }}
COMPILER_TYPE: ${{ matrix.compiler_type }}
DEPLOYMENT_TARGET: ${{ matrix.deployment_target }}
DEPLOYMENT_ARCH: ${{ matrix.deployment_arch }}
QT_VERSION: ${{ matrix.qt_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source
fetch-depth: 0
- name: Setup submodules
shell: bash
run: |
cd source
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true
- name: Install test dependencies
if: runner.os == 'Linux' && matrix.compiler != ''
run: |
sudo apt-get install \
libxkbcommon-x11-0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xfixes0 \
libegl1-mesa \
fonts-noto-cjk
- name: Install compiler
id: install_compiler
if: runner.os == 'Linux' && matrix.compiler != ''
uses: rlalik/setup-cpp-compiler@master
with:
compiler: ${{ matrix.compiler }}
- name: Setup compiler (Linux)
if: runner.os == 'Linux' && matrix.compiler != ''
env:
CC: ${{ steps.install_compiler.outputs.cc }}
CXX: ${{ steps.install_compiler.outputs.cxx }}
run: |
{
echo "CC=$CC"
echo "CXX=$CXX"
} >> "$GITHUB_ENV"
- name: Setup compiler (macOS)
if: runner.os == 'macOS' && matrix.compiler != ''
env:
MLN_COMPILER: ${{ matrix.compiler }}
run: |
# https://github.com/actions/runner-images/issues/8838#issuecomment-1817486924
brew link --overwrite python@3.12
brew install "$MLN_COMPILER"
echo "/usr/local/opt/${MLN_COMPILER}/bin" >> "$GITHUB_PATH"
{
echo "CC=/usr/local/opt/${MLN_COMPILER}/bin/clang"
echo "CXX=/usr/local/opt/${MLN_COMPILER}/bin/clang++"
echo "LDFLAGS=\"-L/usr/local/opt/${MLN_COMPILER}/lib\""
echo "CPPFLAGS=\"-I/usr/local/opt/${MLN_COMPILER}/include\""
} >> "$GITHUB_ENV"
- name: Setup Xcode
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup MSVC
if: matrix.qt_arch == 'win64_msvc2019_64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.compiler_type }}
toolset: ${{ matrix.compiler_version }}
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Download Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ==3.1.*
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}
target: ${{ matrix.qt_target }}
arch: ${{ matrix.qt_arch }}
tools: ${{ matrix.qt_tools }}
- name: Update ccache
if: runner.os == 'Windows'
shell: bash
run: |
# version is pinned due to issues with caching MSVC in 4.8
choco.exe install ccache --version=4.7.5 --no-progress
ccache.exe --version
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> "$GITHUB_ENV"
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: Qt_${{ matrix.name }}_${{ matrix.qt_version }}
max-size: 200M
- name: Build maplibre-native (macOS)
if: runner.os == 'macOS' && matrix.qt_target == 'desktop'
run: |
mkdir build && cd build
cmake ../source/ \
-G Ninja \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \
-DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \
-DMLN_WITH_QT=ON
ninja
- name: Build maplibre-native (Linux, Qt5)
if: runner.os == 'Linux' && matrix.qt_version == '5.15.2'
uses: ./source/.github/actions/qt5-build
- name: Build maplibre-native (Linux, Qt6)
if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' && matrix.compiler == ''
uses: ./source/.github/actions/qt6-build
- name: Build maplibre-native (Linux, Qt6, custom compiler)
if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' && matrix.compiler != ''
run: |
mkdir build && cd build
qt-cmake ../source/ \
-G Ninja \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DMLN_WITH_QT=ON
ninja
- name: Build maplibre-native (Linux, Qt6, custom compiler, internal libraries)
if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' && matrix.compiler != ''
run: |
mkdir build-internal && cd build-internal
qt-cmake ../source/ \
-G Ninja \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DMLN_WITH_QT=ON \
-DMLN_QT_WITH_INTERNAL_ICU=ON \
-DMLN_QT_WITH_INTERNAL_SQLITE=ON
ninja
- name: Run tests (Linux)
if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' && matrix.compiler != ''
uses: coactions/setup-xvfb@v1
with:
run: ctest --output-on-failure
working-directory: build
- name: Build maplibre-native (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
export PATH="$IQTA_TOOLS/$COMPILER_TYPE/bin:$PATH"
echo "$PATH"
mkdir build && cd build
cmake.exe ../source/ \
-G"Ninja Multi-Config" \
-DCMAKE_CONFIGURATION_TYPES="${BUILD_TYPE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \
-DMLN_WITH_QT=ON
ninja.exe