@@ -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.platforms. name }} (${{ matrix.builder.name }}, ${{matrix.platforms.description}}) "
17
+ runs-on : ${{ matrix.platforms. 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
+ platforms :
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 debug_symbols=yes optimize=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 -D CMAKE_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 -DTARGET=TEMPLATE_RELEASE -B build_release test
59
+ cmake --build build_release --config Release -v
60
+
61
+ platforms :
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" -DFLOAT_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/Release/gdexample.windows.template_release.x86_64.lib
98
+ flags :
99
+ Scons : platform=windows
100
+ CMake : ' -G "Visual Studio 16 2019" -A x64'
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,58 +184,62 @@ jobs:
100
184
submodules : recursive
101
185
102
186
- name : Restore Godot build cache
103
- uses : ./.github/actions/godot-cache-restore
187
+ if : ${{ matrix.builder.name == 'SCons' }}
188
+ uses : ./.github/actions/godot-cache
104
189
with :
105
- cache-name : ${{ matrix.cache-name }}
190
+ cache-name : ${{ matrix.platforms. 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.platforms. 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.platforms. 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
- - name : Setup MinGW for Windows/MinGW build
128
- if : ${{ matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes' }}
129
- uses : egor-tensin/setup-mingw@v2
130
- with :
131
- version : 12.2.0
132
-
133
213
- name : Install scons
214
+ if : ${{ matrix.builder.name == 'SCons' }}
134
215
run : |
135
216
python -m pip install scons==4.0.0
136
217
218
+ - name : Install CMake
219
+ if : ${{ matrix.builder.name == 'CMake' }}
220
+ uses : jwlawson/actions-setup-cmake@v2
221
+
222
+ - name : Install ccache
223
+ if : ${{ matrix.builder.name == 'CMake' }}
224
+ uses :
hendrikmuhs/[email protected]
225
+ with :
226
+ key : ${{ matrix.platforms.cache-name }}
227
+
228
+ - name : Install Ninja
229
+ if : ${{ matrix.builder.name == 'CMake' }}
230
+ uses : ashutoshvarma/setup-ninja@master
231
+
137
232
- name : Generate godot-cpp sources only
138
- run : |
139
- scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }}
140
- scons -c
233
+ run : ${{ format(matrix.builder.generate_sources, matrix.platforms.flags[matrix.builder.name]) }}
141
234
142
235
- name : Build godot-cpp (debug)
143
- run : |
144
- scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }}
236
+ run : ${{ format(matrix.builder.build_godot_cpp_debug, matrix.platforms.flags[matrix.builder.name]) }}
145
237
146
238
- 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
239
+ run : ${{ format(matrix.builder.build_debug, matrix.platforms.flags[matrix.builder.name]) }}
150
240
151
241
- name : Build test and godot-cpp (release)
152
- run : |
153
- cd test
154
- scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
242
+ run : ${{ format(matrix.builder.build_release, matrix.platforms.flags[matrix.builder.name]) }}
155
243
156
244
- name : Save Godot build cache
157
245
uses : ./.github/actions/godot-cache-save
@@ -161,7 +249,7 @@ jobs:
161
249
162
250
- name : Download latest Godot artifacts
163
251
uses : dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
164
- if : ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }}
252
+ if : ${{ matrix.platforms. run-tests && env.GODOT_TEST_VERSION == 'master' }}
165
253
with :
166
254
repo : godotengine/godot
167
255
branch : master
@@ -189,84 +277,16 @@ jobs:
189
277
echo "GODOT=$(pwd)/Godot_v${GODOT_TEST_VERSION}_linux.x86_64" >> $GITHUB_ENV
190
278
191
279
- name : Run tests
192
- if : ${{ matrix.run-tests }}
280
+ if : ${{ matrix.platforms. run-tests }}
193
281
run : |
194
282
$GODOT --headless --version
195
283
cd test
196
- # Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
197
- (cd project && (timeout 30 $GODOT --import --headless >/dev/null 2>&1 || true))
198
- ./run-tests.sh
284
+ GODOT=../godot-artifacts/godot.linuxbsd.editor.x86_64.mono ./run-tests.sh
199
285
200
286
- name : Upload artifact
201
287
uses : actions/upload-artifact@v3
202
288
with :
203
- name : ${{ matrix.artifact-name }}
204
- path : ${{ matrix.artifact-path }}
289
+ name : ${{ matrix.platforms. artifact-name }}-${{ matrix.builder. name }}
290
+ path : ${{ matrix.platforms. artifact-path[matrix.builder.name] }}
205
291
if-no-files-found : error
206
292
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 .
224
- make -j $(nproc) VERBOSE=1
225
-
226
- - name : Build test GDExtension library
227
- run : |
228
- cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." .
229
- make -j $(nproc) VERBOSE=1
230
-
231
- linux-cmake-ninja :
232
- name : 🐧 Build (Linux, GCC, CMake Ninja)
233
- runs-on : ubuntu-20.04
234
- steps :
235
- - name : Checkout
236
- uses : actions/checkout@v4
237
- with :
238
- submodules : recursive
239
-
240
- - name : Install dependencies
241
- run : |
242
- sudo apt-get update -qq
243
- sudo apt-get install -qqq build-essential pkg-config cmake ninja-build
244
-
245
- - name : Build godot-cpp
246
- run : |
247
- cmake -DCMAKE_BUILD_TYPE=Release -GNinja .
248
- cmake --build . -j $(nproc) --verbose
249
-
250
- - name : Build test GDExtension library
251
- run : |
252
- cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." -GNinja .
253
- cmake --build . -j $(nproc) --verbose
254
-
255
- windows-msvc-cmake :
256
- name : 🏁 Build (Windows, MSVC, CMake)
257
- runs-on : windows-2019
258
- steps :
259
- - name : Checkout
260
- uses : actions/checkout@v4
261
- with :
262
- submodules : recursive
263
-
264
- - name : Build godot-cpp
265
- run : |
266
- cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" .
267
- cmake --build . --verbose
268
-
269
- - name : Build test GDExtension library
270
- run : |
271
- cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." -G"Visual Studio 16 2019" .
272
- cmake --build . --verbose
0 commit comments