forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
324 lines (304 loc) · 11.8 KB
/
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
name: CI
on:
push:
# Run for pushes to master, e.g. a PR was merged ...
branches:
- master
# ... and only when we've possibly changed how the game will function.
paths:
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- '.github/path-filters.yml'
- 'steam/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- Doxyfile
- keys.txt
pull_request:
# Run for any push to any pull request, if it modifies source code or game text.
types: [opened, synchronize]
paths:
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- '.github/path-filters.yml'
- 'steam/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- Doxyfile
- keys.txt
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Figure out what changed, so other jobs in this file can conditionally execute.
changed:
uses: ./.github/workflows/compute-changes.yml
build_ubuntu:
name: Ubuntu
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
runs-on: ubuntu-${{ matrix.os }}
strategy:
matrix:
os: [22.04, 24.04]
opengl: [GL, GLES]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install development dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libosmesa6 mesa-utils libglvnd-dev x11-utils catch2 libltdl-dev
- name: Disable VM sound card
run: |
sudo sh -c 'echo "pcm.!default { type plug slave.pcm \"null\" }" >> /etc/asound.conf'
- name: Setup cached directories
uses: actions/cache@v4
with:
path: /home/runner/.cache/sccache
key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.opengl }}-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-${{ matrix.opengl }}-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289'
- uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
buildPreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
testPreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
- name: Run Benchmarks
run: ctest --preset ${{ matrix.opengl == 'GL' && 'linux-ci-benchmark' || 'linux-gles-ci-benchmark' }}
build_steam:
name: Steam
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' || needs.changed.outputs.steam == 'true' }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup cached directories
uses: actions/cache@v4
with:
path: /home/runner/.cache/sccache
key: ${{ runner.os }}-steam-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-steam-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- name: Build Endless Sky
run: |
cd steam
docker compose run steam-x64
- name: Test Endless Sky
run: |
cd steam
docker compose run test-steam-x64
build_windows:
name: Windows
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
runs-on: windows-2022
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup cached directories
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
key: ${{ runner.os }}-${{ runner.arch }}-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'mingw-ci'
buildPreset: 'mingw-ci'
testPreset: 'mingw-ci'
- name: Run Benchmarks
run: ctest --preset mingw-ci-benchmark
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: binary-windows
path: ./build/ci/Endless Sky.exe
- name: Upload DLLs
uses: actions/upload-artifact@v4
with:
name: windows-dlls
path: ./build/ci/*.dll
build_windows_clang:
name: Windows Clang
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
runs-on: windows-2022
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup cached directories
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
key: ${{ runner.os }}-clang-${{ runner.arch }}-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-clang-${{ runner.arch }}-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'clang-cl-ci'
buildPreset: 'clang-cl-ci'
testPreset: 'clang-cl-ci'
- name: Run Benchmarks
run: ctest --preset clang-cl-ci-benchmark
build_macos:
name: MacOS
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
runs-on: macos-13
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup cached directories
uses: actions/cache@v4
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-${{ runner.arch }}-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- name: Install pkg-config
run: type -P pkg-config || brew install pkg-config
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'macos-ci'
buildPreset: 'macos-ci'
testPreset: 'macos-ci'
- name: Run Benchmarks
run: ctest --preset macos-ci-benchmark
build_macos-arm:
name: MacOS-ARM
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
runs-on: macos-14
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: "Endless Sky ARM CI Test"
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup cached directories
uses: actions/cache@v4
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-${{ runner.arch }}-ci-sccache-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ci-sccache-refs/heads/master
- name: Setup sccache
uses: Mozilla-Actions/[email protected]
- name: Install pkg-config
run: type -P pkg-config || brew install pkg-config
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'macos-arm-ci'
buildPreset: 'macos-arm-ci'
testPreset: 'macos-arm-ci'
- name: Run Benchmarks
run: ctest --preset macos-arm-ci-benchmark
build_documentation_doxygen:
name: Documentation Doxygen
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.doxygen_config == 'true' || needs.changed.outputs.ci_config == 'true'}}
runs-on: ubuntu-24.04
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install development dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends doxygen graphviz clang
- name: Run Doxygen
run: doxygen
test-parse:
needs: [changed, build_windows]
name: Data Files
if: ${{ (needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.data == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.ci_config == 'true') && always() }}
runs-on: windows-2022
env:
CONTINUOUS: EndlessSky-win64-continuous.zip
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
# If no code changes occurred then we can download the latest continuous.
- name: Download latest continuous
if: ${{ needs.changed.outputs.game_code != 'true' && needs.changed.outputs.cmake_files != 'true' && needs.changed.outputs.ci_config != 'true' }}
run: gh release download -R ${{ github.repository }} continuous -p ${{ env.CONTINUOUS }}
- name: Extract and prepare continuous
if: ${{ needs.changed.outputs.game_code != 'true' && needs.changed.outputs.cmake_files != 'true' && needs.changed.outputs.ci_config != 'true' }}
run: |
Expand-Archive ${{ env.CONTINUOUS }} -DestinationPath continuous -Force
COPY '.\continuous\Endless Sky.exe' .
COPY '.\continuous\*.dll' .
# Otherwise download the binary from CI.
- name: Download game binary from CI
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
uses: actions/download-artifact@v4
with:
name: binary-windows
- name: Download DLLs from CI
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.ci_config == 'true' }}
uses: actions/download-artifact@v4
with:
name: windows-dlls
- name: Parse Datafiles
run: "'./Endless Sky.exe' -p"
shell: bash
- name: Parse Integration Test Data
run: "'./Endless Sky.exe' -p --config 'tests/integration/config'"
shell: bash