Skip to content

Commit

Permalink
Add a separate setup-godot-cpp github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Nov 26, 2024
1 parent a42b363 commit 7f28e85
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 27 deletions.
56 changes: 56 additions & 0 deletions .github/actions/setup-godot-cpp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Setup godot-cpp
description: Setup build dependencies for godot-cpp.

inputs:
platform:
required: true
description: Target platform.
em-version:
default: 3.1.62
description: Emscripten version.
windows-use-mingw:
description: 'Set to true to use MinGW, false otherwise'
required: true
default: 'false'
type: boolean
mingw-version:
default: 12.2.0
description: MinGW version.
scons-version:
default: 4.4.0
description: SCons version.

runs:
using: composite
steps:
- name: Setup Python (for SCons)
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Setup Android dependencies
if: inputs.platform == 'android'
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true

- name: Setup Web dependencies
if: inputs.platform == 'web'
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ inputs.em-version }}
no-cache: true

- name: Setup MinGW for Windows/MinGW build
if: inputs.platform == 'windows' && inputs.windows-use-mingw
uses: egor-tensin/setup-mingw@v2
with:
version: ${{ inputs.mingw-version }}

- name: Setup SCons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==${{ inputs.scons-version }}
scons --version
31 changes: 4 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,34 +108,11 @@ jobs:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Set up Python (for SCons)
uses: actions/setup-python@v5
- name: Setup godot-cpp
uses: ./.github/actions/setup-godot-cpp
with:
python-version: 3.x

- name: Android dependencies
if: matrix.platform == 'android'
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true

- name: Web dependencies
if: matrix.platform == 'web'
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
no-cache: true

- name: Setup MinGW for Windows/MinGW build
if: matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes'
uses: egor-tensin/setup-mingw@v2
with:
version: 12.2.0

- name: Install scons
run: |
python -m pip install scons==4.0.0
platform: ${{ matrix.platform }}
windows-use-mingw: ${{ matrix.flags == 'use_mingw=yes' }}

- name: Generate godot-cpp sources only
run: |
Expand Down

0 comments on commit 7f28e85

Please sign in to comment.