Skip to content

Commit 98e9221

Browse files
Update ci.yml
1 parent 0cbcae1 commit 98e9221

File tree

1 file changed

+70
-183
lines changed

1 file changed

+70
-183
lines changed

.github/workflows/ci.yml

+70-183
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
CPP_VERSION: [ 17, 20, 23 ]
12+
CPP_VERSION: [ 20 ]
1313
env:
1414
VCPKG_ROOT: ${{github.workspace}}/vcpkg
1515
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/bincache
@@ -22,11 +22,18 @@ jobs:
2222
run: |
2323
brew install cmake
2424
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
3037

3138
- name: Restore Vcpkg artifacts
3239
id: restore-vcpkg-artifacts
@@ -54,35 +61,31 @@ jobs:
5461
cmake .. -GNinja \
5562
-DCMAKE_BUILD_TYPE=Debug \
5663
-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
6071
6172
- name: Compile
6273
run: ninja -C build
6374

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
6777

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
7181

7282
ubuntu:
7383
runs-on: ubuntu-latest
7484
if: contains(github.event.head_commit.message, '[skip-ci]') == false
7585
strategy:
7686
fail-fast: false
7787
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 ]
8288
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 }
8689
env:
8790
VCPKG_ROOT: ${{github.workspace}}/vcpkg
8891
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/bincache
@@ -129,6 +132,18 @@ jobs:
129132
fonts-dejavu-core \
130133
libharfbuzz-dev
131134
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+
132147
- name: Restore Vcpkg
133148
id: restore-vcpkg-artifacts
134149
uses: actions/cache@v3
@@ -149,95 +164,6 @@ jobs:
149164
sudo ./vcpkg/vcpkg integrate install
150165
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
151166
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-
241167
- name: Emulate video device
242168
run: |
243169
/sbin/start-stop-daemon --start \
@@ -249,47 +175,32 @@ jobs:
249175
250176
- name: Generate build files
251177
run: |
252-
mkdir build && cd build
178+
mkdir build
179+
cd build
253180
cmake .. -GNinja \
254181
-DCMAKE_BUILD_TYPE=Debug \
255182
-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
260190
261191
- name: Compile
262192
run: ninja -C build
263193

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
267196

268197
- 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
271200

272201
windows:
273202
runs-on: windows-latest
274203
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 }
293204
env:
294205
VCPKG_ROOT: ${{github.workspace}}/vcpkg
295206
steps:
@@ -303,10 +214,17 @@ jobs:
303214
with:
304215
version: 1.11.1
305216

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
310228

311229
- name: Restore Vcpkg
312230
id: restore-vcpkg-artifacts
@@ -327,54 +245,23 @@ jobs:
327245
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics
328246
.\vcpkg\vcpkg integrate install
329247
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-
358248
- 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}}
364249
run: |
365250
mkdir build
366251
cd build
367252
cmake .. -GNinja `
368253
-DCMAKE_BUILD_TYPE=Debug `
369254
-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
373262
374263
- name: Compile
375264
run: ninja -C build
376265

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

Comments
 (0)