@@ -13,78 +13,162 @@ concurrency:
13
13
14
14
jobs :
15
15
build :
16
- name : ${{ matrix.name }}
17
- runs-on : ${{ matrix.os }}
16
+ name : " ${{ matrix.platform. name }} (${{ matrix.builder.name }}, ${{matrix.platform.description}}) "
17
+ runs-on : ${{ matrix.platform. os }}
18
18
strategy :
19
19
fail-fast : false
20
20
matrix :
21
- include :
22
- - name : 🐧 Linux (GCC)
21
+
22
+ # TODO: remove after CMake IOS config is ready
23
+ exclude :
24
+ - builder :
25
+ name : CMake
26
+
27
+ platform :
28
+ name : 🍏 iOS
29
+
30
+ builder :
31
+ - name : SCons
32
+ generate_sources : |
33
+ scons {0} build_library=no verbose=yes
34
+ scons -c
35
+
36
+ build_godot_cpp_debug : |
37
+ scons {0} target=template_debug verbose=yes
38
+
39
+ build_debug : |
40
+ cd test
41
+ scons {0} target=template_debug build_library=no debug_symbols=yes optimize=debug verbose=yes
42
+
43
+ build_release : |
44
+ cd test
45
+ scons {0} target=template_release verbose=yes
46
+
47
+ - name : CMake
48
+ generate_sources : |
49
+ cmake {0} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -B build test
50
+
51
+ build_godot_cpp_debug : |
52
+ cmake --build build --config Debug --target godot-cpp -v
53
+
54
+ build_debug : |
55
+ cmake --build build --config Debug -v
56
+
57
+ build_release : |
58
+ cmake {0} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DGODOT_TARGET=template_release -B build_release test
59
+ cmake --build build_release --config Release -v
60
+
61
+ platform :
62
+ - name : 🐧 Linux
63
+ description : ' GCC'
23
64
os : ubuntu-20.04
24
65
platform : linux
25
66
artifact-name : godot-cpp-linux-glibc2.27-x86_64-release
26
- artifact-path : bin/libgodot-cpp.linux.template_release.x86_64.a
67
+ artifact-path :
68
+ SCons : bin/libgodot-cpp.linux.template_release.x86_64.a
69
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.linux.template_release.x86_64.a
70
+ flags :
71
+ SCons : platform=linux
72
+ CMake : -G "Ninja Multi-Config"
27
73
run-tests : true
28
74
cache-name : linux-x86_64
29
75
30
- - name : 🐧 Linux (GCC, Double Precision)
76
+ - name : 🐧 Linux
77
+ description : ' GCC, Double Precision'
31
78
os : ubuntu-20.04
32
79
platform : linux
33
80
artifact-name : godot-cpp-linux-glibc2.27-x86_64-double-release
34
- artifact-path : bin/libgodot-cpp.linux.template_release.double.x86_64.a
35
- flags : precision=double
81
+ artifact-path :
82
+ SCons : bin/libgodot-cpp.linux.template_release.double.x86_64.a
83
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.linux.template_release.double.x86_64.a
84
+ flags :
85
+ SCons : platform=linux precision=double
86
+ CMake : -G "Ninja Multi-Config" -DGODOT_PRECISION=double
36
87
run-tests : false
37
88
cache-name : linux-x86_64-f64
38
89
39
- - name : 🏁 Windows (x86_64, MSVC)
90
+ - name : 🏁 Windows
91
+ description : ' x86_64, MSVC'
40
92
os : windows-2019
41
93
platform : windows
42
94
artifact-name : godot-cpp-windows-msvc2019-x86_64-release
43
- artifact-path : bin/libgodot-cpp.windows.template_release.x86_64.lib
95
+ artifact-path :
96
+ SCons : bin/libgodot-cpp.windows.template_release.x86_64.lib
97
+ CMake : build_release/godot-cpp/bin/Release/godot-cpp.windows.template_release.x86_64.lib
98
+ flags :
99
+ Scons : platform=windows
100
+ CMake : ' -G "Visual Studio 16 2019" -A x64 -DCMAKE_VERBOSE_MAKEFILE=TRUE'
44
101
run-tests : false
45
102
cache-name : windows-x86_64-msvc
46
103
47
- - name : 🏁 Windows (x86_64, MinGW)
104
+ - name : 🏁 Windows
105
+ description : ' x86_64, MinGW'
48
106
os : windows-2019
49
107
platform : windows
50
108
artifact-name : godot-cpp-linux-mingw-x86_64-release
51
- artifact-path : bin/libgodot-cpp.windows.template_release.x86_64.a
52
- flags : use_mingw=yes
109
+ artifact-path :
110
+ SCons : bin/libgodot-cpp.windows.template_release.x86_64.a
111
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.windows.template_release.x86_64.a
112
+ flags :
113
+ SCons : platform=windows use_mingw=yes
114
+ CMake : -G "Ninja Multi-Config"
115
+ use-mingw : true
53
116
run-tests : false
54
117
cache-name : windows-x86_64-mingw
55
118
56
- - name : 🍎 macOS (universal)
119
+ - name : 🍎 macOS
120
+ description : ' universal'
57
121
os : macos-latest
58
122
platform : macos
59
123
artifact-name : godot-cpp-macos-universal-release
60
- artifact-path : bin/libgodot-cpp.macos.template_release.universal.a
61
- flags : arch=universal
124
+ artifact-path :
125
+ SCons : bin/libgodot-cpp.macos.template_release.universal.a
126
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.macos.template_release.a
127
+ flags :
128
+ SCons : platform=macos arch=universal
129
+ CMake : -G Xcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
62
130
run-tests : false
63
131
cache-name : macos-universal
64
132
65
- - name : 🤖 Android (arm64)
133
+ - name : 🤖 Android
134
+ description : ' arm64'
66
135
os : ubuntu-20.04
67
136
platform : android
68
137
artifact-name : godot-cpp-android-arm64-release
69
- artifact-path : bin/libgodot-cpp.android.template_release.arm64.a
70
- flags : arch=arm64
138
+ artifact-path :
139
+ SCons : bin/libgodot-cpp.android.template_release.arm64.a
140
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.android.template_release.arm64.a
141
+ flags :
142
+ SCons : platform=android arch=arm64
143
+ CMake : --toolchain ${ANDROID_HOME}/ndk/23.2.8568313/build/cmake/android.toolchain.cmake -G "Ninja Multi-Config" -DANDROID_PLATFORM=21
71
144
run-tests : false
72
145
cache-name : android-arm64
73
146
74
- - name : 🍏 iOS (arm64)
147
+ - name : 🍏 iOS
148
+ description : ' arm64'
75
149
os : macos-latest
76
150
platform : ios
77
151
artifact-name : godot-cpp-ios-arm64-release
78
- artifact-path : bin/libgodot-cpp.ios.template_release.arm64.a
79
- flags : arch=arm64
152
+ artifact-path :
153
+ SCons : bin/libgodot-cpp.ios.template_release.arm64.a
154
+ CMake : build_release/godot-cpp/bin/Release/Release/libgodot-cpp.ios.template_release.a
155
+ flags :
156
+ SCons : platform=ios arch=arm64
157
+ CMake : -G Xcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
80
158
run-tests : false
81
159
cache-name : ios-arm64
82
160
83
- - name : 🌐 Web (wasm32)
161
+ - name : 🌐 Web
162
+ description : ' wasm32'
84
163
os : ubuntu-20.04
85
164
platform : web
86
165
artifact-name : godot-cpp-web-wasm32-release
87
- artifact-path : bin/libgodot-cpp.web.template_release.wasm32.a
166
+ artifact-path :
167
+ SCons : bin/libgodot-cpp.web.template_release.wasm32.a
168
+ CMake : build_release/godot-cpp/bin/Release/libgodot-cpp.web.template_release.wasm32.a
169
+ flags :
170
+ SCons : platform=web
171
+ CMake : --toolchain ${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -G "Ninja Multi-Config"
88
172
run-tests : false
89
173
cache-name : web-wasm32
90
174
@@ -100,68 +184,79 @@ jobs:
100
184
submodules : recursive
101
185
102
186
- name : Restore Godot build cache
187
+ if : ${{ matrix.builder.name == 'SCons' }}
103
188
uses : ./.github/actions/godot-cache-restore
104
189
with :
105
- cache-name : ${{ matrix.cache-name }}
190
+ cache-name : ${{ matrix.platform. cache-name }}
106
191
continue-on-error : true
107
192
108
193
- name : Set up Python (for SCons)
194
+ if : ${{ matrix.builder.name == 'SCons' }}
109
195
uses : actions/setup-python@v5
110
196
with :
111
197
python-version : ' 3.x'
112
198
113
199
- name : Android dependencies
114
- if : ${{ matrix.platform == 'android' }}
200
+ if : ${{ matrix.platform.platform == 'android' }}
115
201
uses : nttld/setup-ndk@v1
116
202
with :
117
203
ndk-version : r23c
118
204
link-to-sdk : true
119
205
120
206
- name : Web dependencies
121
- if : ${{ matrix.platform == 'web' }}
207
+ if : ${{ matrix.platform.platform == 'web' }}
122
208
uses : mymindstorm/setup-emsdk@v14
123
209
with :
124
210
version : ${{env.EM_VERSION}}
125
211
actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
126
212
127
213
- name : Setup MinGW for Windows/MinGW build
128
- if : ${{ matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes' }}
214
+ if : ${{ matrix.platform.use-mingw }}
129
215
uses : egor-tensin/setup-mingw@v2
130
216
with :
131
217
version : 12.2.0
132
218
133
219
- name : Install scons
220
+ if : ${{ matrix.builder.name == 'SCons' }}
134
221
run : |
135
222
python -m pip install scons==4.0.0
136
223
224
+ - name : Install CMake
225
+ if : ${{ matrix.builder.name == 'CMake' }}
226
+ uses : jwlawson/actions-setup-cmake@v2
227
+
228
+ - name : Install ccache
229
+ if : ${{ matrix.builder.name == 'CMake' }}
230
+ uses :
hendrikmuhs/[email protected]
231
+ with :
232
+ key : ${{ matrix.platform.cache-name }}
233
+
234
+ - name : Install Ninja
235
+ if : ${{ matrix.builder.name == 'CMake' }}
236
+ uses : ashutoshvarma/setup-ninja@master
237
+
137
238
- name : Generate godot-cpp sources only
138
- run : |
139
- scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }}
140
- scons -c
239
+ run : ${{ format(matrix.builder.generate_sources, matrix.platform.flags[matrix.builder.name]) }}
141
240
142
241
- name : Build godot-cpp (debug)
143
- run : |
144
- scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }}
242
+ run : ${{ format(matrix.builder.build_godot_cpp_debug, matrix.platform.flags[matrix.builder.name]) }}
145
243
146
244
- name : Build test without rebuilding godot-cpp (debug)
147
- run : |
148
- cd test
149
- scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} build_library=no
245
+ run : ${{ format(matrix.builder.build_debug, matrix.platform.flags[matrix.builder.name]) }}
150
246
151
247
- name : Build test and godot-cpp (release)
152
- run : |
153
- cd test
154
- scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
248
+ run : ${{ format(matrix.builder.build_release, matrix.platform.flags[matrix.builder.name]) }}
155
249
156
250
- name : Save Godot build cache
251
+ if : ${{ matrix.builder.name == 'SCons' }}
157
252
uses : ./.github/actions/godot-cache-save
158
253
with :
159
- cache-name : ${{ matrix.cache-name }}
254
+ cache-name : ${{ matrix.platform. cache-name }}
160
255
continue-on-error : true
161
256
162
257
- name : Download latest Godot artifacts
163
258
uses : dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
164
- if : ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }}
259
+ if : ${{ matrix.platform. run-tests && env.GODOT_TEST_VERSION == 'master' }}
165
260
with :
166
261
repo : godotengine/godot
167
262
branch : master
@@ -175,21 +270,21 @@ jobs:
175
270
path : godot-artifacts
176
271
177
272
- name : Prepare Godot artifacts for testing
178
- if : ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }}
273
+ if : ${{ matrix.platform. run-tests && env.GODOT_TEST_VERSION == 'master' }}
179
274
run : |
180
275
chmod +x ./godot-artifacts/godot.linuxbsd.editor.x86_64.mono
181
276
echo "GODOT=$(pwd)/godot-artifacts/godot.linuxbsd.editor.x86_64.mono" >> $GITHUB_ENV
182
277
183
278
- name : Download requested Godot version for testing
184
- if : ${{ matrix.run-tests && env.GODOT_TEST_VERSION != 'master' }}
279
+ if : ${{ matrix.platform. run-tests && env.GODOT_TEST_VERSION != 'master' }}
185
280
run : |
186
281
wget "https://github.com/godotengine/godot-builds/releases/download/${GODOT_TEST_VERSION}/Godot_v${GODOT_TEST_VERSION}_linux.x86_64.zip" -O Godot.zip
187
282
unzip -a Godot.zip
188
283
chmod +x "Godot_v${GODOT_TEST_VERSION}_linux.x86_64"
189
284
echo "GODOT=$(pwd)/Godot_v${GODOT_TEST_VERSION}_linux.x86_64" >> $GITHUB_ENV
190
285
191
286
- name : Run tests
192
- if : ${{ matrix.run-tests }}
287
+ if : ${{ matrix.platform. run-tests }}
193
288
run : |
194
289
$GODOT --headless --version
195
290
cd test
@@ -200,70 +295,6 @@ jobs:
200
295
- name : Upload artifact
201
296
uses : actions/upload-artifact@v3
202
297
with :
203
- name : ${{ matrix.artifact-name }}
204
- path : ${{ matrix.artifact-path }}
298
+ name : ${{ matrix.platform. artifact-name }}-${{ matrix.builder. name }}
299
+ path : ${{ matrix.platform. artifact-path[matrix.builder.name] }}
205
300
if-no-files-found : error
206
-
207
- linux-cmake :
208
- name : 🐧 Build (Linux, GCC, CMake)
209
- runs-on : ubuntu-20.04
210
- steps :
211
- - name : Checkout
212
- uses : actions/checkout@v4
213
- with :
214
- submodules : recursive
215
-
216
- - name : Install dependencies
217
- run : |
218
- sudo apt-get update -qq
219
- sudo apt-get install -qqq build-essential pkg-config cmake
220
-
221
- - name : Build godot-cpp
222
- run : |
223
- cmake -DCMAKE_BUILD_TYPE=Release -Bbuild test
224
- cmake --build build -v -j $(nproc) --target godot-cpp
225
-
226
- - name : Build test GDExtension library
227
- run : |
228
- cmake --build build -v -j $(nproc)
229
-
230
- linux-cmake-ninja :
231
- name : 🐧 Build (Linux, GCC, CMake Ninja)
232
- runs-on : ubuntu-20.04
233
- steps :
234
- - name : Checkout
235
- uses : actions/checkout@v4
236
- with :
237
- submodules : recursive
238
-
239
- - name : Install dependencies
240
- run : |
241
- sudo apt-get update -qq
242
- sudo apt-get install -qqq build-essential pkg-config cmake ninja-build
243
-
244
- - name : Build godot-cpp
245
- run : |
246
- cmake -DCMAKE_BUILD_TYPE=Release -GNinja -Bbuild test
247
- cmake --build build -v -j $(nproc) --target godot-cpp
248
-
249
- - name : Build test GDExtension library
250
- run : |
251
- cmake --build build -v -j $(nproc)
252
-
253
- windows-msvc-cmake :
254
- name : 🏁 Build (Windows, MSVC, CMake)
255
- runs-on : windows-2019
256
- steps :
257
- - name : Checkout
258
- uses : actions/checkout@v4
259
- with :
260
- submodules : recursive
261
-
262
- - name : Build godot-cpp
263
- run : |
264
- cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" -Bbuild test
265
- cmake --build build -v --target godot-cpp
266
-
267
- - name : Build test GDExtension library
268
- run : |
269
- cmake --build build -v
0 commit comments