9
9
strategy :
10
10
fail-fast : false
11
11
matrix :
12
- CPP_VERSION : [ 17, 20, 23 ]
12
+ CPP_VERSION : [ 20 ]
13
13
env :
14
14
VCPKG_ROOT : ${{github.workspace}}/vcpkg
15
15
VCPKG_DEFAULT_BINARY_CACHE : ${{github.workspace}}/vcpkg/bincache
@@ -22,11 +22,18 @@ jobs:
22
22
run : |
23
23
brew install cmake
24
24
brew install ninja
25
- brew install glfw
26
- brew install sdl2
27
- brew install sdl2_image
28
- brew install sdl2_mixer
29
- brew install sdl2_ttf
25
+
26
+ - name : Restore assets
27
+ id : restore-assets
28
+ uses : actions/cache@v3
29
+ with :
30
+ path : " assets"
31
+ key : centurion-macos-download-assets-${{hashFiles('scripts/download_assets.py')}}
32
+
33
+ - name : Download assets
34
+ working-directory : ./scripts
35
+ if : steps.restore-assets.outputs.cache-hit != 'true'
36
+ run : python download_assets.py
30
37
31
38
- name : Restore Vcpkg artifacts
32
39
id : restore-vcpkg-artifacts
@@ -54,35 +61,31 @@ jobs:
54
61
cmake .. -GNinja \
55
62
-DCMAKE_BUILD_TYPE=Debug \
56
63
-DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} \
57
- -DBUILD_TESTS=ON \
58
- -DBUILD_EXAMPLES=ON \
59
- -DTREAT_WARNINGS_AS_ERRORS=ON
64
+ -DCEN_USE_SYSTEM_SDL=OFF \
65
+ -DCEN_USE_SDL_IMAGE=ON \
66
+ -DCEN_USE_SDL_MIXER=ON \
67
+ -DCEN_USE_SDL_TTF=ON \
68
+ -DCEN_BUILD_UNIT_TESTS=ON \
69
+ -DCEN_BUILD_DEMO_TESTS=ON \
70
+ -DCEN_WARNINGS_AS_ERRORS=OFF
60
71
61
72
- name : Compile
62
73
run : ninja -C build
63
74
64
- - name : Run unit tests
65
- working-directory : ./build/test/unit-tests
66
- run : ./centurion-tests
75
+ - name : Install
76
+ run : ninja install -C build
67
77
68
- - name : Run mock tests
69
- working-directory : ./build/test/mocked-tests
70
- run : ./centurion-mocks
78
+ - name : Run unit tests
79
+ working-directory : ./build/test/unit
80
+ run : ./centurion-unit-tests
71
81
72
82
ubuntu :
73
83
runs-on : ubuntu-latest
74
84
if : contains(github.event.head_commit.message, '[skip-ci]') == false
75
85
strategy :
76
86
fail-fast : false
77
87
matrix :
78
- SDL_VERSION : [ 2.0.20, 2.0.22, 2.24.0, 2.26.0 ]
79
- TTF_VERSION : [ 2.20.2 ]
80
- IMG_VERSION : [ 2.6.3 ]
81
- MIX_VERSION : [ 2.6.3 ]
82
88
CPP_VERSION : [ 20 ]
83
- include :
84
- - { SDL_VERSION: 2.26.0, TTF_VERSION: 2.20.2, IMG_VERSION: 2.6.3, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
85
- - { SDL_VERSION: 2.26.0, TTF_VERSION: 2.20.2, IMG_VERSION: 2.6.3, MIX_VERSION: 2.6.3, CPP_VERSION: 23 }
86
89
env :
87
90
VCPKG_ROOT : ${{github.workspace}}/vcpkg
88
91
VCPKG_DEFAULT_BINARY_CACHE : ${{github.workspace}}/vcpkg/bincache
@@ -129,6 +132,18 @@ jobs:
129
132
fonts-dejavu-core \
130
133
libharfbuzz-dev
131
134
135
+ - name : Restore assets
136
+ id : restore-assets
137
+ uses : actions/cache@v3
138
+ with :
139
+ path : " assets"
140
+ key : centurion-ubuntu-download-assets-${{hashFiles('scripts/download_assets.py')}}
141
+
142
+ - name : Download assets
143
+ working-directory : ./scripts
144
+ if : steps.restore-assets.outputs.cache-hit != 'true'
145
+ run : python download_assets.py
146
+
132
147
- name : Restore Vcpkg
133
148
id : restore-vcpkg-artifacts
134
149
uses : actions/cache@v3
@@ -149,95 +164,6 @@ jobs:
149
164
sudo ./vcpkg/vcpkg integrate install
150
165
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
151
166
152
- - name : Restore SDL2
153
- id : restore-sdl2
154
- uses : actions/cache@v3
155
- with :
156
- path : SDL2-${{matrix.SDL_VERSION}}
157
- key : SDL2-${{matrix.SDL_VERSION}}
158
-
159
- - name : Build SDL2
160
- if : steps.restore-sdl2.outputs.cache-hit != 'true'
161
- run : |
162
- wget https://www.libsdl.org/release/SDL2-${{matrix.SDL_VERSION}}.tar.gz
163
- tar -xf SDL2-${{matrix.SDL_VERSION}}.tar.gz
164
- rm -rf SDL2-${{matrix.SDL_VERSION}}.tar.gz
165
- cd SDL2-${{matrix.SDL_VERSION}}
166
- ./configure
167
- make -j $(nproc)
168
-
169
- - name : Install SDL2
170
- run : |
171
- cd SDL2-${{matrix.SDL_VERSION}}
172
- sudo make install
173
-
174
- - name : Restore SDL2_image
175
- id : restore-sdl2-image
176
- uses : actions/cache@v3
177
- with :
178
- path : SDL_image-release-${{ matrix.IMG_VERSION }}
179
- key : SDL_image-${{ matrix.IMG_VERSION }}
180
-
181
- - name : Build SDL2_image
182
- if : steps.restore-sdl2-image.outputs.cache-hit != 'true'
183
- run : |
184
- wget https://github.com/libsdl-org/SDL_image/archive/refs/tags/release-${{ matrix.IMG_VERSION }}.tar.gz
185
- tar -xf release-${{ matrix.IMG_VERSION }}.tar.gz
186
- rm -rf release-${{ matrix.IMG_VERSION }}.tar.gz
187
- cd SDL_image-release-${{ matrix.IMG_VERSION }}
188
- ./configure
189
- make -j $(nproc)
190
-
191
- - name : Install SDL2_image
192
- run : |
193
- cd SDL_image-release-${{ matrix.IMG_VERSION }}
194
- sudo make install
195
-
196
- - name : Restore SDL2_mixer
197
- id : restore-sdl2-mixer
198
- uses : actions/cache@v3
199
- with :
200
- path : SDL_mixer-release-${{ matrix.MIX_VERSION }}
201
- key : SDL2_mixer-${{ matrix.MIX_VERSION }}
202
-
203
- - name : Build SDL2_mixer
204
- if : steps.restore-sdl2-mixer.outputs.cache-hit != 'true'
205
- run : |
206
- wget https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-${{ matrix.MIX_VERSION }}.tar.gz
207
- tar -xf release-${{ matrix.MIX_VERSION }}.tar.gz
208
- rm -rf release-${{ matrix.MIX_VERSION }}.tar.gz
209
- cd SDL_mixer-release-${{ matrix.MIX_VERSION }}
210
- ./configure
211
- make -j $(nproc)
212
-
213
- - name : Install SDL2_mixer
214
- run : |
215
- cd SDL_mixer-release-${{ matrix.MIX_VERSION }}
216
- sudo make install
217
-
218
- - name : Restore SDL2_ttf
219
- id : restore-sdl2-ttf
220
- uses : actions/cache@v3
221
- with :
222
- path : SDL_ttf-release-${{ matrix.TTF_VERSION }}
223
- key : SDL2_ttf-${{ matrix.TTF_VERSION }}
224
-
225
- - name : Build SDL2_ttf
226
- if : steps.restore-sdl2-ttf.outputs.cache-hit != 'true'
227
- run : |
228
- wget https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-${{ matrix.TTF_VERSION }}.tar.gz
229
- tar -xf release-${{ matrix.TTF_VERSION }}.tar.gz
230
- rm -rf release-${{ matrix.TTF_VERSION }}.tar.gz
231
- cd SDL_ttf-release-${{ matrix.TTF_VERSION }}
232
- ./autogen.sh
233
- ./configure --disable-harfbuzz-builtin --disable-freetype-builtin --without-x
234
- make -j $(nproc)
235
-
236
- - name : Install SDL2_ttf
237
- run : |
238
- cd SDL_ttf-release-${{ matrix.TTF_VERSION }}
239
- sudo make install
240
-
241
167
- name : Emulate video device
242
168
run : |
243
169
/sbin/start-stop-daemon --start \
@@ -249,47 +175,32 @@ jobs:
249
175
250
176
- name : Generate build files
251
177
run : |
252
- mkdir build && cd build
178
+ mkdir build
179
+ cd build
253
180
cmake .. -GNinja \
254
181
-DCMAKE_BUILD_TYPE=Debug \
255
182
-DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} \
256
- -DBUILD_TESTS=ON \
257
- -DBUILD_EXAMPLES=ON \
258
- -DINCLUDE_AUDIO_TESTS=OFF \
259
- -DTREAT_WARNINGS_AS_ERRORS=ON
183
+ -DCEN_USE_SYSTEM_SDL=OFF \
184
+ -DCEN_USE_SDL_IMAGE=ON \
185
+ -DCEN_USE_SDL_MIXER=ON \
186
+ -DCEN_USE_SDL_TTF=ON \
187
+ -DCEN_BUILD_UNIT_TESTS=ON \
188
+ -DCEN_BUILD_DEMO_TESTS=ON \
189
+ -DCEN_WARNINGS_AS_ERRORS=OFF
260
190
261
191
- name : Compile
262
192
run : ninja -C build
263
193
264
- - name : Run mocked tests
265
- working-directory : ./build/test/mocked-tests
266
- run : ./centurion-mocks
194
+ - name : Install
195
+ run : ninja install -C build
267
196
268
197
- name : Run unit tests
269
- working-directory : ./build/test/unit-tests
270
- run : ./centurion-tests
198
+ working-directory : ./build/test/unit
199
+ run : ./centurion-unit- tests
271
200
272
201
windows :
273
202
runs-on : windows-latest
274
203
if : contains(github.event.head_commit.message, '[skip-ci]') == false
275
- strategy :
276
- fail-fast : false
277
- matrix :
278
- SDL_VERSION : [ 2.24.0, 2.26.0 ]
279
- TTF_VERSION : [ 2.0.18, 2.20.1 ]
280
- IMG_VERSION : [ 2.0.5, 2.6.2 ]
281
- MIX_VERSION : [ 2.6.3 ]
282
- CPP_VERSION : [ 20 ]
283
- include :
284
- - { SDL_VERSION: 2.0.10, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
285
- - { SDL_VERSION: 2.0.12, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
286
- - { SDL_VERSION: 2.0.14, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
287
- - { SDL_VERSION: 2.0.16, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
288
- - { SDL_VERSION: 2.0.18, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
289
- - { SDL_VERSION: 2.0.20, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
290
- - { SDL_VERSION: 2.0.22, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 17 }
291
- - { SDL_VERSION: 2.24.0, TTF_VERSION: 2.0.18, IMG_VERSION: 2.0.5, MIX_VERSION: 2.6.3, CPP_VERSION: 20 }
292
- - { SDL_VERSION: 2.26.0, TTF_VERSION: 2.20.1, IMG_VERSION: 2.6.2, MIX_VERSION: 2.6.3, CPP_VERSION: 23 }
293
204
env :
294
205
VCPKG_ROOT : ${{github.workspace}}/vcpkg
295
206
steps :
@@ -303,10 +214,17 @@ jobs:
303
214
with :
304
215
version : 1.11.1
305
216
306
- - name : Print dependency versions
307
- run : |
308
- cmake --version
309
- ninja --version
217
+ - name : Restore assets
218
+ id : restore-assets
219
+ uses : actions/cache@v3
220
+ with :
221
+ path : " assets"
222
+ key : centurion-windows-download-assets-${{hashFiles('scripts/download_assets.py')}}
223
+
224
+ - name : Download assets
225
+ working-directory : ./scripts
226
+ if : steps.restore-assets.outputs.cache-hit != 'true'
227
+ run : python download_assets.py
310
228
311
229
- name : Restore Vcpkg
312
230
id : restore-vcpkg-artifacts
@@ -327,54 +245,23 @@ jobs:
327
245
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics
328
246
.\vcpkg\vcpkg integrate install
329
247
330
- - name : Download SDL2
331
- uses : albin-johansson/download-sdl2@latest
332
- with :
333
- version : ${{matrix.SDL_VERSION}}
334
- sources_destination : .
335
- binaries_destination : bin
336
-
337
- - name : Download SDL2_image
338
- uses : albin-johansson/download-sdl2-image@latest
339
- with :
340
- version : ${{matrix.IMG_VERSION}}
341
- sources_destination : .
342
- binaries_destination : bin
343
-
344
- - name : Download SDL2_ttf
345
- uses : albin-johansson/download-sdl2-ttf@latest
346
- with :
347
- version : ${{matrix.TTF_VERSION}}
348
- sources_destination : .
349
- binaries_destination : bin
350
-
351
- - name : Download SDL2_mixer
352
- uses : albin-johansson/download-sdl2-mixer@latest
353
- with :
354
- version : ${{matrix.MIX_VERSION}}
355
- sources_destination : .
356
- binaries_destination : bin
357
-
358
248
- name : Generate build files
359
- env :
360
- SDL2DIR : ${{github.workspace}}/SDL2-${{matrix.SDL_VERSION}}
361
- SDL2IMAGEDIR : ${{github.workspace}}/SDL2_image-${{matrix.IMG_VERSION}}
362
- SDL2MIXERDIR : ${{github.workspace}}/SDL2_mixer-${{matrix.MIX_VERSION}}
363
- SDL2TTFDIR : ${{github.workspace}}/SDL2_ttf-${{matrix.TTF_VERSION}}
364
249
run : |
365
250
mkdir build
366
251
cd build
367
252
cmake .. -GNinja `
368
253
-DCMAKE_BUILD_TYPE=Debug `
369
254
-DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} `
370
- -DBUILD_TESTS=ON `
371
- -DBUILD_EXAMPLES=ON `
372
- -DTREAT_WARNINGS_AS_ERRORS=ON
255
+ -DCEN_USE_SYSTEM_SDL=OFF `
256
+ -DCEN_USE_SDL_IMAGE=ON `
257
+ -DCEN_USE_SDL_MIXER=ON `
258
+ -DCEN_USE_SDL_TTF=ON `
259
+ -DCEN_BUILD_UNIT_TESTS=ON `
260
+ -DCEN_BUILD_DEMO_TESTS=ON `
261
+ -DCEN_WARNINGS_AS_ERRORS=OFF
373
262
374
263
- name : Compile
375
264
run : ninja -C build
376
265
377
- - name : Run mocked tests
378
- shell : cmd
379
- working-directory : ./build/test/mocked-tests
380
- run : centurion-mocks
266
+ - name : Install
267
+ run : ninja install -C build
0 commit comments