@@ -25,22 +25,53 @@ jobs:
2525 fail-fast : false
2626 matrix :
2727 include :
28+ # Linux: Standard tests with bash
2829 - name : 🐧 Linux (GCC)
2930 os : ubuntu-22.04
3031 platform : linux
3132 artifact-name : godot-cpp-linux-glibc2.27-x86_64-release
3233 artifact-path : bin/libgodot-cpp.linux.template_release.x86_64.a
3334 run-tests : true
3435 cache-name : linux-x86_64
35-
36+ godot_workflow : linux_builds.yml
37+ godot_artifact_name : linux-editor-mono
38+ godot_binary_path : godot.linuxbsd.editor.x86_64.mono
39+ test_shell : bash
40+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_linux.x86_64.zip
41+ stable_binary_path : Godot_v4.5.1-stable_linux.x86_64
42+
43+ # Windows MSVC: Tests with pwsh, .exe binary
3644 - name : 🏁 Windows (x86_64, MSVC)
3745 os : windows-2022
3846 platform : windows
3947 artifact-name : godot-cpp-windows-msvc2019-x86_64-release
4048 artifact-path : bin/libgodot-cpp.windows.template_release.x86_64.lib
41- run-tests : false
49+ run-tests : true # Enabled: Uses PS1 script
4250 cache-name : windows-x86_64-msvc
43-
51+ godot_workflow : windows_builds.yml
52+ godot_artifact_name : windows-editor-mono
53+ godot_binary_path : godot.windows.editor.x86_64.mono.exe
54+ test_shell : pwsh
55+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_win64.zip
56+ stable_binary_path : Godot_v4.5.1-stable_win64.exe
57+
58+ # macOS: Tests with bash, .app path
59+ - name : 🍎 macOS (universal)
60+ os : macos-latest
61+ platform : macos
62+ artifact-name : godot-cpp-macos-universal-release
63+ artifact-path : bin/libgodot-cpp.macos.template_release.universal.a
64+ flags : arch=universal
65+ run-tests : true # Enabled: Quick macOS validation
66+ cache-name : macos-universal
67+ godot_workflow : macos_builds.yml
68+ godot_artifact_name : macos-editor-mono
69+ godot_binary_path : Godot.app/Contents/MacOS/Godot # Inside .app bundle
70+ test_shell : bash
71+ stable_url : https://github.com/godotengine/godot-builds/releases/download/4.5.1-stable/Godot_v4.5.1-stable_macos.universal.zip
72+ stable_binary_path : Godot_v4.5.1-stable_macos.universal/Godot.app/Contents/MacOS/Godot
73+
74+ # Other platforms: No tests, no godot vars
4475 - name : 🏁 Windows (x86_64, MinGW)
4576 os : windows-2022
4677 platform : windows
5081 run-tests : false
5182 cache-name : windows-x86_64-mingw
5283
53- - name : 🍎 macOS (universal)
54- os : macos-latest
55- platform : macos
56- artifact-name : godot-cpp-macos-universal-release
57- artifact-path : bin/libgodot-cpp.macos.template_release.universal.a
58- flags : arch=universal
59- run-tests : false
60- cache-name : macos-universal
61-
6284 - name : 🤖 Android (arm64)
6385 os : ubuntu-22.04
6486 platform : android
@@ -133,43 +155,91 @@ jobs:
133155 cache-name : ${{ matrix.cache-name }}
134156 continue-on-error : true
135157
158+ # Godot Download & Prep (only if run-tests: true)
136159 - name : Download latest Godot artifacts
137- uses : dsnopek/action -download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
160+ id : godot -download
138161 if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
162+ uses : dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
139163 with :
140164 repo : godotengine/godot
141165 branch : master
142166 event : push
143- workflow : linux_builds.yml
167+ workflow : ${{ matrix.godot_workflow }}
144168 workflow_conclusion : success
145- name : linux-editor-mono
169+ name : ${{ matrix.godot_artifact_name }}
146170 search_artifacts : true
147171 check_artifacts : true
148172 ensure_latest : true
149173 path : godot-artifacts
150-
151- - name : Prepare Godot artifacts for testing
152- if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
174+ if_no_artifact_found : warn
175+ continue-on-error : true # Allows fallback step
176+
177+ - name : Download stable Godot (fallback or non-master)
178+ id : godot-fallback
179+ if : |
180+ matrix.run-tests &&
181+ (
182+ (env.GODOT_TEST_VERSION == 'master' && steps.godot-download.outcome != 'success') ||
183+ env.GODOT_TEST_VERSION != 'master'
184+ )
185+ shell : ${{ matrix.test_shell }}
186+ run : |
187+ # wget/unzip to stable (matrix provides exact URL/path)
188+ curl -L -o Godot.zip "${{ matrix.stable_url }}"
189+ unzip -q Godot.zip
190+ # Set GODOT env (platform-specific path from matrix)
191+ echo "GODOT=$(pwd)/${{ matrix.stable_binary_path }}" >> $GITHUB_ENV
192+
193+ - name : Prepare Godot binary from artifacts
194+ if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master' && steps.godot-download.outcome == 'success'
195+ shell : ${{ matrix.test_shell }}
153196 run : |
154- chmod +x ./godot-artifacts/godot.linuxbsd.editor.x86_64.mono
155- echo "GODOT=$(pwd)/godot-artifacts/godot.linuxbsd.editor.x86_64.mono" >> $GITHUB_ENV
197+ # chmod only if not Windows (matrix binary_path assumes extracted name)
198+ if [ "${{ matrix.platform }}" != "windows" ]; then
199+ chmod +x "./godot-artifacts/${{ matrix.godot_binary_path }}"
200+ fi
201+ # Set GODOT env
202+ echo "GODOT=$(pwd)/godot-artifacts/${{ matrix.godot_binary_path }}" >> $GITHUB_ENV
203+
204+ - name : Verify Godot binary
205+ if : matrix.run-tests
206+ shell : ${{ matrix.test_shell }}
207+ run : $GODOT --headless --version # Confirms correct binary loaded
156208
157- - name : Download requested Godot version for testing
158- if : matrix.run-tests && env.GODOT_TEST_VERSION != 'master'
209+ # Test Execution (separate for clarity; scripts handle internals)
210+ - name : Prep project import
211+ if : matrix.run-tests
212+ shell : ${{ matrix.test_shell }}
159213 run : |
160- wget "https://github.com/godotengine/godot-builds/releases/download/${GODOT_TEST_VERSION}/Godot_v${GODOT_TEST_VERSION}_linux.x86_64.zip" -O Godot.zip
161- unzip -a Godot.zip
162- chmod +x "Godot_v${GODOT_TEST_VERSION}_linux.x86_64"
163- echo "GODOT=$(pwd)/Godot_v${GODOT_TEST_VERSION}_linux.x86_64" >> $GITHUB_ENV
214+ cd test/project
215+ # Timeout import (30s, ignore crash)
216+ timeout 30 $GODOT --import --headless || true # Bash; for pwsh, matrix.shell handles equiv if needed
164217
165- - name : Run tests
218+ - name : Run unit tests
166219 if : matrix.run-tests
220+ shell : ${{ matrix.test_shell }}
221+ working-directory : test
167222 run : |
168- $GODOT --headless --version
169- cd test
170- # Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
171- (cd project && (timeout 30 $GODOT --import --headless >/dev/null 2>&1 || true))
172- ./run-tests.sh
223+ # Calls run-tests.sh/ps1 for first half (unit tests)
224+ if [ "${{ matrix.test_shell }}" = "pwsh" ]; then
225+ pwsh -File ./run-tests.ps1 --unit-only # Assume PS1 updated with flag; else split script
226+ else
227+ ./run-tests.sh --unit-only # Assume bash updated with flag
228+ fi
229+
230+ - name : Run reload test
231+ if : matrix.run-tests
232+ shell : ${{ matrix.test_shell }}
233+ working-directory : test
234+ run : |
235+ # Handles lock/filtering in script
236+ rm -f project/test_reload_lock # Pre-clean (cross-shell safe)
237+ if [ "${{ matrix.test_shell }}" = "pwsh" ]; then
238+ pwsh -File ./run-tests.ps1 --reload-only
239+ else
240+ ./run-tests.sh --reload-only
241+ fi
242+ rm -f project/test_reload_lock # Post-clean
173243
174244 - name : Upload artifact
175245 uses : actions/upload-artifact@v4
0 commit comments