Skip to content

Commit 832c629

Browse files
committed
Add run-tests.py
This supercedes the bash test script as it can run on more platforms
1 parent 41cfbd1 commit 832c629

File tree

6 files changed

+985
-103
lines changed

6 files changed

+985
-103
lines changed
Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,110 @@
11
name: Setup godot-cpp
2-
description: Setup build dependencies for godot-cpp.
2+
description: Setup build dependencies for godot-cpp (SCons or CMake).
33

44
inputs:
55
platform:
66
required: true
77
description: Target platform.
8-
em-version:
9-
default: 4.0.11
10-
description: Emscripten version.
11-
windows-compiler:
12-
required: true
13-
description: The compiler toolchain to use on Windows ('mingw' or 'msvc').
148
type: choice
159
options:
16-
- mingw
10+
- linux
11+
- windows
12+
- macos
13+
- android
14+
- web
15+
16+
compiler:
17+
description: Compiler toolchain (auto selects sensible default per platform).
18+
required: false
19+
default: auto
20+
type: choice
21+
options:
22+
- auto
23+
- gcc
24+
- clang
1725
- msvc
18-
default: mingw
26+
- mingw
27+
1928
mingw-version:
2029
default: 12.2.0
21-
description: MinGW version.
30+
description: MinGW version (used only for windows + mingw).
31+
2232
ndk-version:
2333
default: r28b
2434
description: Android NDK version.
35+
36+
em-version:
37+
default: 3.1.74
38+
description: Emscripten version (recommended for Godot 4.x web).
39+
2540
buildtool:
41+
description: Build tool to prepare (scons or cmake).
2642
default: scons
27-
description: scons or cmake
43+
type: choice
44+
options:
45+
- scons
46+
- cmake
47+
2848
scons-version:
29-
default: 4.4.0
49+
default: 4.8.0
3050
description: SCons version.
3151

32-
3352
runs:
3453
using: composite
3554
steps:
36-
- name: Setup Python (for SCons)
55+
- name: Setup Python
3756
uses: actions/setup-python@v5
3857
with:
39-
python-version: 3.x
58+
python-version: 3.12
4059

41-
- name: Setup Android dependencies
42-
if: inputs.platform == 'android'
60+
# === Compiler Toolchain Setup ===
61+
62+
- name: Setup Clang on Linux or Windows
63+
if: ${{ (inputs.platform == 'linux' || inputs.platform == 'windows') && inputs.compiler == 'clang' }}
64+
uses: egor-tensin/setup-clang@v2
65+
with:
66+
version: 18
67+
68+
- name: Setup MinGW (Windows)
69+
if: ${{ inputs.platform == 'windows' && (inputs.compiler == 'mingw' || (inputs.compiler == 'auto' && inputs.compiler != 'msvc')) }}
70+
uses: egor-tensin/setup-mingw@v2
71+
with:
72+
version: ${{ inputs.mingw-version }}
73+
74+
# MSVC requires no extra setup on windows-latest runners (Visual Studio is preinstalled)
75+
76+
- name: Setup Android NDK
77+
if: ${{ inputs.platform == 'android' }}
4378
uses: nttld/setup-ndk@v1
4479
with:
4580
ndk-version: ${{ inputs.ndk-version }}
4681
link-to-sdk: true
4782

48-
- name: Setup Web dependencies
49-
if: inputs.platform == 'web'
83+
- name: Setup Emscripten (Web)
84+
if: ${{ inputs.platform == 'web' }}
5085
uses: mymindstorm/setup-emsdk@v14
5186
with:
5287
version: ${{ inputs.em-version }}
5388
no-cache: true
5489

55-
- name: Setup MinGW for Windows/MinGW build
56-
if: inputs.platform == 'windows' && inputs.windows-compiler == 'mingw'
57-
uses: egor-tensin/setup-mingw@v2
58-
with:
59-
version: ${{ inputs.mingw-version }}
90+
# macOS uses AppleClang by default — no extra setup needed on macos-latest
91+
92+
# === Build Tool Setup ===
6093

6194
- name: Setup SCons
6295
if: ${{ inputs.buildtool == 'scons' }}
6396
shell: bash
6497
run: |
65-
python -c "import sys; print(sys.version)"
6698
python -m pip install scons==${{ inputs.scons-version }}
6799
scons --version
68100
69-
- name: Install Ninja
101+
- name: Install Ninja (for CMake)
70102
if: ${{ inputs.buildtool == 'cmake' }}
71-
uses: ashutoshvarma/setup-ninja@master
103+
uses: ashutoshvarma/setup-ninja@v1.1
104+
105+
- name: Debug chosen configuration
106+
shell: bash
107+
run: |
108+
echo "Platform : ${{ inputs.platform }}"
109+
echo "Compiler : ${{ inputs.compiler }}"
110+
echo "Buildtool: ${{ inputs.buildtool }}"

0 commit comments

Comments
 (0)