-
-
Notifications
You must be signed in to change notification settings - Fork 992
399 lines (341 loc) · 11.5 KB
/
ci-main.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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
# run after all other jobs have completed to check overall build status
discord-notification:
runs-on: ubuntu-20.04
name: Discord Notification
needs: [ubuntu-2004-scons-gcc-release-lto, ubuntu-2004-scons-clang-debug, ubuntu-2004-cmake-clang-release, ubuntu-2004-cmake-gcc-debug, steam-runtime, mingw, flatpak, translations, macos-intel-master-release, macos-intel-master-debug, windows-release, windows-debug]
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: rjstone/discord-webhook-notify@v1
if: env.WORKFLOW_CONCLUSION == 'failure' && github.event_name == 'push'
with:
severity: error
webhookUrl: ${{ secrets.DISCORD_CI_WEBHOOK }}
description: |-
pusher: ${{ github.actor }}
commit: ${{ github.event.head_commit.message }}
commit url: ${{ github.event.head_commit.url }}
ubuntu-2004-scons-gcc-release-lto:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Ubuntu 20.04
run: |
export BRANCH=master
export IMAGE=2004
export NLS=false
export TOOL=scons
export CC=gcc
export CXX=g++
export CXX_STD=17
export CFG=release
export LTO=true
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
ubuntu-2004-scons-clang-debug:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Ubuntu 20.04
run: |
export BRANCH=master
export IMAGE=2004
export NLS=false
export TOOL=scons
export CC=clang
export CXX=clang++
export CXX_STD=17
export CFG=debug
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh master
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Ubuntu-Clang-Debug
path: |
~/build-cache/wesnoth
~/build-cache/wesnothd
ubuntu-2004-cmake-clang-release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Ubuntu 20.04
run: |
export BRANCH=master
export IMAGE=2004
export NLS=false
export TOOL=cmake
export CC=clang
export CXX=clang++
export CXX_STD=17
export CFG=release
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
ubuntu-2004-cmake-gcc-debug:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Ubuntu 20.04
run: |
export BRANCH=master
export IMAGE=2004
export NLS=false
export TOOL=cmake
export CC=gcc
export CXX=g++
export CXX_STD=17
export CFG=debug
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Ubuntu-GCC-Debug
path: |
~/build-cache/wesnoth
~/build-cache/wesnothd
steam-runtime:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Steam Runtime
run: |
export BRANCH=master
export IMAGE=steamrt
export NLS=false
export TOOL=scons
export CC=gcc-9
export CXX=g++-9
export CXX_STD=17
export CFG=release
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
mingw:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: MinGW Crosscompile
run: |
export BRANCH=master
export IMAGE=mingw
export NLS=false
export TOOL=scons
export CC=gcc
export CXX=g++
export CXX_STD=17
export CFG=release
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
flatpak:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Flatpak
run: |
export BRANCH=master
export IMAGE=flatpak
export NLS=false
export TOOL=scons
export CC=gcc
export CXX=g++
export CXX_STD=17
export CFG=release
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
translations:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Translations
run: |
export BRANCH=master
export IMAGE=2004
export NLS=only
export TOOL=scons
export CC=gcc
export CXX=g++
export CXX_STD=17
export CFG=release
export LTO=false
export CACHE_DIR=/home/wesnoth-CI/build
./.github/workflows/ci-scripts/ubuntu.sh
macos-intel-master-release:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: macOS Intel Release
run: |
export CFG=Release
export CACHE_DIR=~/build-cache
./.github/workflows/ci-scripts/macos.sh
macos-intel-master-debug:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: macOS Intel Debug
run: |
export CFG=Debug
export CACHE_DIR=~/build-cache
./.github/workflows/ci-scripts/macos.sh
- name: Upload
uses: actions/upload-artifact@v2
with:
name: macOS-Intel-Debug
path: |
~/work/wesnoth/wesnoth/projectfiles/Xcode/Wesnoth_Debug.dmg
# enabling both intel and arm macOS jobs would tend to confuse the github actions CI
# sometimes it would succeed, other times it would fail at random with extra entries for macOS jobs that didn't exist in this configuration file
# try re-enabling at some point to see if this got fixed in the mean time
# macos-arm-master-release:
# runs-on: macos-11.0
#
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: "recursive"
#
# - name: macOS ARM Release
# run: |
# export CFG=Release
# export CACHE_DIR=~/build-cache
# ./.github/workflows/ci-scripts/macos.sh
# macos-arm-master-debug:
# runs-on: macos-11.0
#
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: "recursive"
#
# - name: macOS ARM Debug
# run: |
# export CFG=Debug
# export CACHE_DIR=~/build-cache
# ./.github/workflows/ci-scripts/macos.sh
# - name: Upload
# uses: actions/upload-artifact@v2
# with:
# name: macOS-ARM-Debug
# path: |
# ~/work/wesnoth/wesnoth/projectfiles/Xcode/Wesnoth_Debug.dmg
# in the case of needing to recompile the vcpkg-created Windows dependencies, increment the cache-name and key for both Release and Debug
# this will create a brand new cache and recompile the vcpkg dependencies from scratch
windows-debug:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Cache object files
id: windows-master-N007
uses: actions/cache@v2
with:
path: |
D:/a/wesnoth/vcpkg
D:/a/wesnoth/wesnoth/vcpkg_installed
key: windows-master-N008
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build vcpkg
shell: cmd
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git D:/a/wesnoth/vcpkg
D:/a/wesnoth/vcpkg/bootstrap-vcpkg.bat
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: '3.20'
- name: Use cmake
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_MYSQL=false -DENABLE_NLS=false -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=D:/a/wesnoth/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 16 2019" .
# delete buildtrees directory to free up space after cmake invokes vcpkg to build the dependencies
# otherwise the job was failing when trying to write a .obj file
# building vcpkg on the more spacious C drive didn't work since for some reason vcpkg decides to not create the pango/cairo pkgconfig files there
- name: Build wesnoth
shell: cmd
run: |
rmdir /s /q D:\a\wesnoth\vcpkg\buildtrees
MSBuild.exe wesnoth.sln -p:Configuration=Debug
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Windows-Debug
path: |
D:/a/wesnoth/wesnoth/Debug/wesnoth.exe
D:/a/wesnoth/wesnoth/Debug/wesnothd.exe
D:/a/wesnoth/wesnoth/Debug/wesnoth.pdb
D:/a/wesnoth/wesnoth/Debug/wesnothd.pdb
windows-release:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Cache object files
id: windows-master-N008
uses: actions/cache@v2
with:
path: |
D:/a/wesnoth/vcpkg
D:/a/wesnoth/wesnoth/vcpkg_installed
key: windows-master-N007
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build vcpkg
shell: cmd
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git D:/a/wesnoth/vcpkg
D:/a/wesnoth/vcpkg/bootstrap-vcpkg.bat
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: '3.20'
- name: Use cmake
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_MYSQL=false -DENABLE_NLS=false -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=D:/a/wesnoth/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 16 2019" .
# delete buildtrees directory to free up space after cmake invokes vcpkg to build the dependencies
# otherwise the job was failing when trying to write a .obj file
# building vcpkg on the more spacious C drive didn't work since for some reason vcpkg decides to not create the pango/cairo pkgconfig files there
- name: Build wesnoth
shell: cmd
run: |
rmdir /s /q D:\a\wesnoth\vcpkg\buildtrees
MSBuild.exe wesnoth.sln -p:Configuration=Release
- name: Run WML unit tests
shell: cmd
run: |
python run_wml_tests -v -g -c -t 20 -p D:/a/wesnoth/wesnoth/Release/wesnoth.exe