@@ -32,76 +32,131 @@ jobs:
3232 fail-fast : false
3333 matrix :
3434 include :
35+ # Linux: Standard tests
3536 - name : 🐧 Linux (GCC, Makefiles)
3637 os : ubuntu-22.04
3738 platform : linux
39+ compiler : ' '
3840 config-flags : -DCMAKE_BUILD_TYPE=Release
41+ build-flags : ' '
3942 artifact-name : godot-cpp-linux-glibc2.27-x86_64-release.cmake
4043 artifact-path : cmake-build/bin/libgodot-cpp.linux.template_release.x86_64.a
44+ flags : ' '
4145 run-tests : true
46+ godot_workflow : linux_builds.yml
47+ godot_artifact_name : linux-editor-mono
48+ godot_binary_path : godot.linuxbsd.editor.x86_64.mono
49+ test_shell : bash
50+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_linux.x86_64.zip
51+ stable_binary_path : Godot_v4.5.1-stable_linux.x86_64
4252
53+ # Windows MSVC: Tests (will call .ps1 via conditional)
4354 - name : 🏁 Windows (x86_64, MSVC)
4455 os : windows-2022
4556 platform : windows
4657 compiler : msvc
58+ config-flags : ' '
4759 build-flags : --config Release
4860 artifact-name : godot-cpp-windows-msvc2019-x86_64-release.cmake
4961 artifact-path : cmake-build/bin/libgodot-cpp.windows.template_release.x86_64.lib
50- run-tests : false
51-
52- - name : 🏁 Windows (x86_64, MinGW, Ninja)
53- os : windows-2022
54- platform : windows
55- compiler : mingw
56- config-flags :
57- -GNinja -DCMAKE_BUILD_TYPE=Release
58- -DCMAKE_CXX_COMPILER=cc -DCMAKE_CXX_COMPILER=c++
59- artifact-name : godot-cpp-linux-mingw-x86_64-release.cmake
60- artifact-path : cmake-build/bin/libgodot-cpp.windows.template_release.x86_64.a
61- run-tests : false
62+ flags : ' '
63+ run-tests : true
64+ godot_workflow : windows_builds.yml
65+ godot_artifact_name : windows-editor-mono
66+ godot_binary_path : godot.windows.editor.x86_64.mono.exe
67+ test_shell : pwsh
68+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_win64.zip
69+ stable_binary_path : Godot_v4.5.1-stable_win64.exe
6270
71+ # macOS: Tests
6372 - name : 🍎 macOS (universal, Makefiles)
6473 os : macos-latest
6574 platform : macos
75+ compiler : ' '
6676 config-flags : -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
77+ build-flags : ' '
6778 artifact-name : godot-cpp-macos-universal-release.cmake
6879 artifact-path : cmake-build/bin/libgodot-cpp.macos.template_release.universal.a
80+ flags : ' '
81+ run-tests : true
82+ godot_workflow : macos_builds.yml
83+ godot_artifact_name : macos-editor-mono
84+ godot_binary_path : Godot.app/Contents/MacOS/Godot
85+ test_shell : bash
86+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_macos.universal.zip
87+ stable_binary_path : Godot_v4.5.1-stable_macos.universal/Godot.app/Contents/MacOS/Godot
88+
89+ # Windows MinGW: No tests
90+ - name : 🏁 Windows (x86_64, MinGW, Ninja)
91+ os : windows-2022
92+ platform : windows
93+ compiler : mingw
94+ config-flags : -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cc -DCMAKE_CXX_COMPILER=c++
95+ build-flags : ' '
96+ artifact-name : godot-cpp-linux-mingw-x86_64-release.cmake
97+ artifact-path : cmake-build/bin/libgodot-cpp.windows.template_release.x86_64.a
98+ flags : ' '
6999 run-tests : false
100+ godot_workflow : ' '
101+ godot_artifact_name : ' '
102+ godot_binary_path : ' '
103+ test_shell : bash
104+ stable_url : ' '
105+ stable_binary_path : ' '
70106
107+ # Android: No tests
71108 - name : 🤖 Android (arm64, Ninja)
72109 os : ubuntu-22.04
73110 platform : android
74- config-flags :
75- -G Ninja -DCMAKE_BUILD_TYPE=Release
76- --toolchain ${ANDROID_HOME}/ndk/28.1.13356709/build/cmake/android.toolchain.cmake
77- -DANDROID_PLATFORM=24 -DANDROID_ABI=arm64-v8a
111+ compiler : ' '
112+ config-flags : -G Ninja -DCMAKE_BUILD_TYPE=Release --toolchain ${ANDROID_HOME}/ndk/28.1.13356709/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=24 -DANDROID_ABI=arm64-v8a
113+ build-flags : ' '
78114 artifact-name : godot-cpp-android-arm64-release.cmake
79115 artifact-path : cmake-build/bin/libgodot-cpp.android.template_release.arm64.a
80116 flags : arch=arm64
81117 run-tests : false
118+ godot_workflow : ' '
119+ godot_artifact_name : ' '
120+ godot_binary_path : ' '
121+ test_shell : bash
122+ stable_url : ' '
123+ stable_binary_path : ' '
82124
125+ # iOS: No tests
83126 - name : 🍏 iOS (arm64, XCode)
84127 os : macos-latest
85128 platform : ios
86- config-flags :
87- -G Xcode
88- --toolchain cmake/ios.toolchain.cmake
89- -DPLATFORM=OS64
129+ compiler : ' '
130+ config-flags : -G Xcode --toolchain cmake/ios.toolchain.cmake -DPLATFORM=OS64
90131 build-flags : --config Release
91132 artifact-name : godot-cpp-ios-arm64-release.cmake
92133 artifact-path : cmake-build/bin/libgodot-cpp.ios.template_release.arm64.a
93134 flags : arch=arm64
94135 run-tests : false
136+ godot_workflow : ' '
137+ godot_artifact_name : ' '
138+ godot_binary_path : ' '
139+ test_shell : bash
140+ stable_url : ' '
141+ stable_binary_path : ' '
95142
143+ # Web: No tests
96144 - name : 🌐 Web (wasm32, Ninja)
97145 os : ubuntu-22.04
98146 platform : web
99- config-flags :
100- -G Ninja -DCMAKE_BUILD_TYPE=Release
101- --toolchain ${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
147+ compiler : ' '
148+ config-flags : -G Ninja -DCMAKE_BUILD_TYPE=Release --toolchain ${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
149+ build-flags : ' '
102150 artifact-name : godot-cpp-web-wasm32-release.cmake
103151 artifact-path : cmake-build/bin/libgodot-cpp.web.template_release.wasm32.a
152+ flags : ' '
104153 run-tests : false
154+ godot_workflow : ' '
155+ godot_artifact_name : ' '
156+ godot_binary_path : ' '
157+ test_shell : bash
158+ stable_url : ' '
159+ stable_binary_path : ' '
105160
106161 steps :
107162 - name : Checkout
@@ -120,63 +175,99 @@ jobs:
120175 buildtool : cmake
121176
122177 - name : Configure godot-cpp-test with template_debug
123- run : >
124- cmake --log-level=VERBOSE -S . -B cmake-build ${{ env.config-flags }} ${{ matrix.config-flags }}
178+ run : cmake --log-level=VERBOSE -S . -B cmake-build ${{ env.config-flags }} ${{ matrix.config-flags }}
125179
126180 - name : Build godot-cpp-test (template_debug)
127- run : >
128- cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}
181+ run : cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}
129182
130183 - name : Configure godot-cpp-test with template_release
131- run : >
132- cmake --fresh --log-level=VERBOSE -S . -B cmake-build
133- -DGODOTCPP_TARGET=template_release ${{ env.config-flags }} ${{ matrix.config-flags }}
184+ run : cmake --fresh --log-level=VERBOSE -S . -B cmake-build -DGODOTCPP_TARGET=template_release ${{ env.config-flags }} ${{ matrix.config-flags }}
134185
135186 - name : Build godot-cpp-test (template_release)
136- run : >
137- cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}
187+ run : cmake --build cmake-build --verbose --target godot-cpp-test ${{ matrix.build-flags }}
138188
139189 - name : Run sccache stat for check
140190 shell : bash
141191 run : ${SCCACHE_PATH} --show-stats
142192
193+ # Godot Download & Prep (only if run-tests: true)
143194 - name : Download latest Godot artifacts
144- uses : dsnopek/action -download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
195+ id : godot -download
145196 if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
197+ uses : dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
146198 with :
147199 repo : godotengine/godot
148200 branch : master
149201 event : push
150- workflow : linux_builds.yml
202+ workflow : ${{ matrix.godot_workflow }}
151203 workflow_conclusion : success
152- name : linux-editor-mono
204+ name : ${{ matrix.godot_artifact_name }}
153205 search_artifacts : true
154206 check_artifacts : true
155207 ensure_latest : true
156208 path : godot-artifacts
209+ if_no_artifact_found : warn
210+ continue-on-error : true
157211
158- - name : Prepare Godot artifacts for testing
159- if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
212+ - name : Download stable Godot (fallback or non-master)
213+ id : godot-fallback
214+ if : |
215+ matrix.run-tests &&
216+ (
217+ (env.GODOT_TEST_VERSION == 'master' && steps.godot-download.outcome != 'success') ||
218+ env.GODOT_TEST_VERSION != 'master'
219+ )
220+ shell : bash
160221 run : |
161- chmod +x ./godot-artifacts/godot.linuxbsd.editor.x86_64.mono
162- echo "GODOT=$(pwd)/godot-artifacts/godot.linuxbsd.editor.x86_64.mono" >> $GITHUB_ENV
222+ curl -L -o Godot.zip "${{ matrix.stable_url }}"
223+ unzip -q Godot.zip
224+ echo "GODOT=$(pwd)/${{ matrix.stable_binary_path }}" >> $GITHUB_ENV
163225
164- - name : Download requested Godot version for testing
165- if : matrix.run-tests && env.GODOT_TEST_VERSION != 'master'
226+ - name : Prepare Godot binary from artifacts
227+ if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master' && steps.godot-download.outcome == 'success'
228+ shell : bash
166229 run : |
167- wget "https://github.com/godotengine/godot-builds/releases/download/${GODOT_TEST_VERSION}/Godot_v${GODOT_TEST_VERSION}_linux.x86_64.zip" -O Godot.zip
168- unzip -a Godot.zip
169- chmod +x "Godot_v${GODOT_TEST_VERSION}_linux.x86_64"
170- echo "GODOT=$(pwd)/Godot_v${GODOT_TEST_VERSION}_linux.x86_64 " >> $GITHUB_ENV
230+ if [ "${{ matrix.platform }}" != "windows" ]; then
231+ chmod +x "./godot-artifacts/${{ matrix.godot_binary_path }}"
232+ fi
233+ echo "GODOT=$(pwd)/godot-artifacts/${{ matrix.godot_binary_path }} " >> $GITHUB_ENV
171234
172- - name : Run tests
235+ - name : Verify Godot binary
173236 if : matrix.run-tests
237+ shell : bash
238+ run : $GODOT --headless --version
239+
240+ # Test Execution
241+ - name : Prep project import
242+ if : matrix.run-tests
243+ shell : bash
244+ run : |
245+ cd test/project
246+ timeout 30 $GODOT --import --headless || true
247+
248+ - name : Run unit tests
249+ if : matrix.run-tests
250+ shell : bash
251+ working-directory : test
252+ run : |
253+ if [ "${{ runner.os }}" = "Windows" ]; then
254+ pwsh -File ./run-tests.ps1 --unit-only
255+ else
256+ ./run-tests.sh --unit-only
257+ fi
258+
259+ - name : Run reload test
260+ if : matrix.run-tests
261+ shell : bash
262+ working-directory : test
174263 run : |
175- $GODOT --headless --version
176- cd test
177- # Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
178- (cd project && (timeout 30 $GODOT --import --headless >/dev/null 2>&1 || true))
179- ./run-tests.sh
264+ rm -f project/test_reload_lock
265+ if [ "${{ runner.os }}" = "Windows" ]; then
266+ pwsh -File ./run-tests.ps1 --reload-only
267+ else
268+ ./run-tests.sh --reload-only
269+ fi
270+ rm -f project/test_reload_lock
180271
181272 - name : Upload artifact
182273 uses : actions/upload-artifact@v4
0 commit comments