-
Notifications
You must be signed in to change notification settings - Fork 3
296 lines (248 loc) · 10 KB
/
Copy pathci.yml
File metadata and controls
296 lines (248 loc) · 10 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
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
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux:
name: Linux / ${{ matrix.name }}
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: GCC
cc: gcc
cxx: g++
package: g++
- name: Clang
cc: clang
cxx: clang++
package: clang
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake desktop-file-utils locales ninja-build qt6-base-dev ${{ matrix.package }}
# qt_comma_locale_open needs a comma-decimal locale. The runner image
# ships no language packs, so generate one: without it the test falls
# back to building a locale with localedef, and if that ever stops
# working it would skip and CI would stay green over the regression.
sudo locale-gen de_DE.UTF-8
- name: Configure
run: cmake --preset default -DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset default --parallel 4
- name: Test
run: ctest --preset default --parallel 4
- name: Install check
run: |
cmake --install build --prefix "${RUNNER_TEMP}/install-test"
test -x "${RUNNER_TEMP}/install-test/bin/amrexplorer"
test -x "${RUNNER_TEMP}/install-test/bin/amrexplorer-server"
desktop-file-validate \
"${RUNNER_TEMP}/install-test/share/applications/amrexplorer.desktop"
macos:
name: macOS / AppleClang
runs-on: macos-15
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: brew install cmake ninja qt
- name: Configure
run: cmake --preset default -DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset default --parallel 4
- name: Test
run: ctest --preset default --parallel 4
- name: Install check
run: |
cmake --install build --prefix "${RUNNER_TEMP}/install-test"
test -x "${RUNNER_TEMP}/install-test/amrexplorer.app/Contents/MacOS/amrexplorer"
test -x "${RUNNER_TEMP}/install-test/bin/amrexplorer-server"
remote:
name: Linux / headless remote server
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake g++ ninja-build
- name: Configure
run: >-
cmake --preset remote
-DAMREXPLORER_ENABLE_SERVER_TEST_HOOKS=ON
-DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset remote --parallel 4
- name: Test
run: ctest --preset remote --parallel 4
windows:
name: Windows / MSVC
runs-on: windows-2022
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Qt
uses: jurplel/install-qt-action@a9c63c7c123f3069cff414e7e482d95dfa9d8125 # v4.4.1
with:
version: 6.8.*
arch: win64_msvc2022_64
cache: true
# The test hooks are on here for one reason: the whole-response write
# budget's regression lives in remote_server's trickle case, which needs
# them, and this is the only job that covers that budget on Windows.
# test_remote_frame proves it deterministically everywhere else, but its
# socket-pair cases are POSIX-only.
#
# The cost was weighed and accepted: no job now builds Windows in the
# configuration a user gets. That is tolerable because the hook seam is
# purely additive -- a hooks-off build compiles a strict subset -- and
# because linux, macos, qt-sanitizers and sanitizers all still build with
# hooks off. The one thing it could hide is a header that reaches some
# translation unit only by way of ServerTestHooks.hpp. Giving
# test_remote_frame a Windows socket pair would let this go back to OFF
# and cover the budget both ways; that is the way out if it ever matters.
- name: Configure
run: >-
cmake --preset windows
-DAMREXPLORER_ENABLE_SERVER_TEST_HOOKS=ON
-DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset windows --parallel 4
- name: Test
run: ctest --preset windows --parallel 4
# The only job that compiles the tests-off shape. MainWindowTestAccess.cpp and
# main.cpp's ~56 gated CLI branches are excluded by AMREXPLORER_QT_TEST_ACCESS,
# which follows AMREXPLORER_BUILD_TESTS, so every other job here compiles the
# gate's ON side only. Without this, reordering a branch inside a guarded run
# -- or a formatter rejoining the `} else` / `#endif` / `if` splice -- breaks
# a build nobody runs while CI stays green.
#
# It covers both shapes that ship: the desktop build and the server-only one
# (Qt off, remote on), each installed to a throwaway prefix. There are no
# tests to run in either -- that is the whole point of the job -- so what it
# can still check past compiling is what the install puts in front of a user.
release-shape:
name: Linux / no tests (release shape)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake g++ ninja-build qt6-base-dev
- name: Configure (default, tests off)
run: >-
cmake --preset default
-DAMREXPLORER_BUILD_TESTS=OFF
-DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build (default, tests off)
run: cmake --build --preset default --parallel 4
# The shape a user installs, so this is where the install rules are worth
# checking: the two executables land in bin, the desktop entry with them,
# and amrexplorer-render-equivalence stays out (it is EXCLUDE_FROM_ALL in
# the tools component precisely so it does not).
- name: Install check
run: |
cmake --install build --prefix "${RUNNER_TEMP}/install-test"
test -x "${RUNNER_TEMP}/install-test/bin/amrexplorer"
test -x "${RUNNER_TEMP}/install-test/bin/amrexplorer-server"
test -f \
"${RUNNER_TEMP}/install-test/share/applications/amrexplorer.desktop"
test ! -e \
"${RUNNER_TEMP}/install-test/bin/amrexplorer-render-equivalence"
# The server-only shape: Qt off, remote on. Nothing else builds it with
# tests off, and its install must carry the server without the GUI or the
# desktop entry that goes with one.
- name: Configure (remote, tests off)
run: >-
cmake --preset remote
-DAMREXPLORER_BUILD_TESTS=OFF
-DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build (remote, tests off)
run: cmake --build --preset remote --parallel 4
- name: Install check (remote, tests off)
run: |
cmake --install build-remote --prefix "${RUNNER_TEMP}/install-remote"
test -x "${RUNNER_TEMP}/install-remote/bin/amrexplorer-server"
test ! -e "${RUNNER_TEMP}/install-remote/bin/amrexplorer"
test ! -d "${RUNNER_TEMP}/install-remote/share/applications"
sanitizers:
name: Linux / ASan + UBSan
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake g++ ninja-build
- name: Configure
run: cmake --preset sanitizers -DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset sanitizers --parallel 4
- name: Test
run: ctest --preset sanitizers --parallel 4
qt-sanitizers:
name: Linux / Qt + ASan + UBSan
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake g++ locales ninja-build qt6-base-dev
# See the linux job: qt_comma_locale_open needs a comma locale, and a
# skip here would be a silent green over the LC_NUMERIC regression.
sudo locale-gen de_DE.UTF-8
- name: Configure
run: cmake --preset qt-sanitizers -DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset qt-sanitizers --parallel 4
- name: Test
run: ctest --preset qt-sanitizers --parallel 4
tsan:
name: Linux / TSan
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes cmake g++ ninja-build
- name: Configure
run: >-
cmake --preset tsan
-DAMREXPLORER_ENABLE_SERVER_TEST_HOOKS=ON
-DAMREXPLORER_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build --preset tsan --parallel 4
- name: Test
run: ctest --preset tsan --parallel 4