Skip to content

Commit fb06c07

Browse files
committed
Add a separate setup-godot-cpp github action.
1 parent a42b363 commit fb06c07

File tree

2 files changed

+63
-27
lines changed

2 files changed

+63
-27
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Setup godot-cpp
2+
description: Setup build dependencies for godot-cpp.
3+
4+
inputs:
5+
platform:
6+
required: true
7+
description: Target platform.
8+
em-version:
9+
default: 3.1.62
10+
description: Emscripten version.
11+
windows-use-mingw:
12+
description: 'Set to true to use MinGW, false otherwise'
13+
required: true
14+
default: 'false'
15+
type: boolean
16+
mingw-version:
17+
default: 12.2.0
18+
description: MinGW version.
19+
ndk-version:
20+
default: r23c
21+
description: Android NDK version.
22+
scons-version:
23+
default: 4.4.0
24+
description: SCons version.
25+
26+
runs:
27+
using: composite
28+
steps:
29+
- name: Setup Python (for SCons)
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: 3.x
33+
34+
- name: Setup Android dependencies
35+
if: inputs.platform == 'android'
36+
uses: nttld/setup-ndk@v1
37+
with:
38+
ndk-version: ${{ inputs.ndk-version }}
39+
link-to-sdk: true
40+
41+
- name: Setup Web dependencies
42+
if: inputs.platform == 'web'
43+
uses: mymindstorm/setup-emsdk@v14
44+
with:
45+
version: ${{ inputs.em-version }}
46+
no-cache: true
47+
48+
- name: Setup MinGW for Windows/MinGW build
49+
if: inputs.platform == 'windows' && inputs.windows-use-mingw
50+
uses: egor-tensin/setup-mingw@v2
51+
with:
52+
version: ${{ inputs.mingw-version }}
53+
54+
- name: Setup SCons
55+
shell: bash
56+
run: |
57+
python -c "import sys; print(sys.version)"
58+
python -m pip install scons==${{ inputs.scons-version }}
59+
scons --version

.github/workflows/ci.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,11 @@ jobs:
108108
cache-name: ${{ matrix.cache-name }}
109109
continue-on-error: true
110110

111-
- name: Set up Python (for SCons)
112-
uses: actions/setup-python@v5
111+
- name: Setup godot-cpp
112+
uses: ./.github/actions/setup-godot-cpp
113113
with:
114-
python-version: 3.x
115-
116-
- name: Android dependencies
117-
if: matrix.platform == 'android'
118-
uses: nttld/setup-ndk@v1
119-
with:
120-
ndk-version: r23c
121-
link-to-sdk: true
122-
123-
- name: Web dependencies
124-
if: matrix.platform == 'web'
125-
uses: mymindstorm/setup-emsdk@v14
126-
with:
127-
version: ${{ env.EM_VERSION }}
128-
no-cache: true
129-
130-
- name: Setup MinGW for Windows/MinGW build
131-
if: matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes'
132-
uses: egor-tensin/setup-mingw@v2
133-
with:
134-
version: 12.2.0
135-
136-
- name: Install scons
137-
run: |
138-
python -m pip install scons==4.0.0
114+
platform: ${{ matrix.platform }}
115+
windows-use-mingw: ${{ matrix.flags == 'use_mingw=yes' }}
139116

140117
- name: Generate godot-cpp sources only
141118
run: |

0 commit comments

Comments
 (0)