55env :
66 # Only used for the cache key. Increment version to force clean build.
77 GODOT_BASE_BRANCH : master
8- # Used to select the version of Godot to run the tests with.
9- GODOT_TEST_VERSION : master
108 # Use UTF-8 on Linux.
119 LANG : en_US.UTF-8
1210 LC_ALL : en_US.UTF-8
3331 run-tests : true
3432 cache-name : linux-x86_64
3533
34+ - name : 🐧 Linux (GCC) for Godot 4.5
35+ os : ubuntu-22.04
36+ platform : linux
37+ artifact-name : godot-cpp-linux-glibc2.27-x86_64-release-godot45
38+ artifact-path : bin/libgodot-cpp.linux.template_release.x86_64.a
39+ run-tests : true
40+ api-version : 4.5
41+ godot-test-versions : " 4.5-stable"
42+ cache-name : linux-x86_64-godot45
43+
3644 - name : 🏁 Windows (x86_64, MSVC)
3745 os : windows-2022
3846 platform : windows
@@ -110,22 +118,23 @@ jobs:
110118
111119 - name : Generate godot-cpp sources only
112120 run : |
113- scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }}
121+ scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }} ${{ matrix.api-version && format('api_version={0}', matrix.api-version) || '' }}
114122 scons -c
115123
116124 - name : Build godot-cpp (debug)
117125 run : |
118- scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }}
126+ scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} ${{ matrix.api-version && format('api_version={0}', matrix.api-version) || '' }}
127+
119128
120129 - name : Build test without rebuilding godot-cpp (debug)
121130 run : |
122131 cd test
123- scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} build_library=no
132+ scons platform=${{ matrix.platform }} verbose=yes build_library=no target=template_debug ${{ matrix.flags }} ${{ matrix.api-version && format('api_version={0}', matrix.api-version) || '' }}
124133
125134 - name : Build test and godot-cpp (release)
126135 run : |
127136 cd test
128- scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
137+ scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }} ${{ matrix.api-version && format('api_version={0}', matrix.api-version) || '' }}
129138
130139 - name : Save Godot build cache
131140 uses : ./.github/actions/godot-cache-save
@@ -135,7 +144,7 @@ jobs:
135144
136145 - name : Download latest Godot artifacts
137146 uses : dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
138- if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
147+ if : matrix.run-tests
139148 with :
140149 repo : godotengine/godot
141150 branch : master
@@ -149,27 +158,38 @@ jobs:
149158 path : godot-artifacts
150159
151160 - name : Prepare Godot artifacts for testing
152- if : matrix.run-tests && env.GODOT_TEST_VERSION == 'master'
161+ if : matrix.run-tests
153162 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
163+ mkdir ./godot-builds
164+ mv ./godot-artifacts/godot.linuxbsd.editor.x86_64.mono ./godot-builds/godot-master
165+ mv ./godot-artifacts/GodotSharp ./godot-builds/
166+ chmod +x ./godot-builds/godot-master
156167
157- - name : Download requested Godot version for testing
158- if : matrix.run-tests && env.GODOT_TEST_VERSION != 'master'
168+ - name : Download supported Godot versions for testing
169+ if : matrix.run-tests && matrix.godot-test-versions
159170 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
171+ for version in ${{ matrix.godot-test-versions }}; do
172+ wget "https://github.com/godotengine/godot-builds/releases/download/${version}/Godot_v${version}_linux.x86_64.zip" -O Godot.zip
173+ unzip -a Godot.zip
174+ mv "Godot_v${version}_linux.x86_64" "./godot-builds/godot-${version}"
175+ chmod +x "./godot-builds/godot-${version}"
176+ rm Godot.zip
177+ done
164178
165179 - name : Run tests
166180 if : matrix.run-tests
167181 run : |
168- $GODOT --headless --version
182+ GODOT_BUILDS="$(pwd)/godot-builds"
169183 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
184+ for version in ${{ matrix.godot-test-versions }} master; do
185+ rm -rf ./project/.godot
186+ export GODOT="${GODOT_BUILDS}/godot-${version}"
187+ $GODOT --headless --version
188+ # Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
189+ (cd project && (timeout 30 $GODOT --import --headless >/dev/null 2>&1 || true))
190+ ./run-tests.sh
191+ done
192+ cd ..
173193
174194 - name : Upload artifact
175195 uses : actions/upload-artifact@v4
0 commit comments