2023-08-01 20:38:07 +02:00
|
|
|
name: 🪲 Godot CPP
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
# Global Settings
|
|
|
|
env:
|
2023-09-01 23:11:51 +02:00
|
|
|
# Used for the cache key. Add version suffix to force clean build.
|
2023-08-01 20:38:07 +02:00
|
|
|
GODOT_BASE_BRANCH: master
|
2023-09-01 23:11:51 +02:00
|
|
|
# Used for the godot-cpp checkout.
|
2024-07-08 17:41:20 +02:00
|
|
|
GODOT_CPP_BRANCH: 4.3
|
2023-08-01 20:38:07 +02:00
|
|
|
|
|
|
|
concurrency:
|
2024-07-08 17:41:20 +02:00
|
|
|
group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-cpp-tests
|
2023-08-01 20:38:07 +02:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
godot-cpp-tests:
|
2024-07-08 17:41:20 +02:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Build and test Godot CPP
|
2023-08-01 20:38:07 +02:00
|
|
|
steps:
|
2024-07-08 17:41:20 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-03-16 03:52:47 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-08-01 20:38:07 +02:00
|
|
|
|
2024-05-17 09:28:56 +02:00
|
|
|
- name: Setup Python and SCons
|
2023-08-01 20:38:07 +02:00
|
|
|
uses: ./.github/actions/godot-deps
|
|
|
|
|
|
|
|
# Checkout godot-cpp
|
|
|
|
- name: Checkout godot-cpp
|
2023-09-04 16:05:38 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-08-01 20:38:07 +02:00
|
|
|
with:
|
|
|
|
repository: godotengine/godot-cpp
|
2023-09-01 23:11:51 +02:00
|
|
|
ref: ${{ env.GODOT_CPP_BRANCH }}
|
2024-07-08 17:41:20 +02:00
|
|
|
submodules: recursive
|
|
|
|
path: godot-cpp
|
2023-08-01 20:38:07 +02:00
|
|
|
|
|
|
|
# Download generated API dump
|
|
|
|
- name: Download GDExtension interface and API dump
|
|
|
|
uses: ./.github/actions/download-artifact
|
|
|
|
with:
|
2024-07-08 17:41:20 +02:00
|
|
|
name: godot-api-dump
|
|
|
|
path: ./godot-api
|
2023-08-01 20:38:07 +02:00
|
|
|
|
|
|
|
# Extract and override existing files with generated files
|
|
|
|
- name: Extract GDExtension interface and API dump
|
|
|
|
run: |
|
|
|
|
cp -f godot-api/gdextension_interface.h godot-cpp/gdextension/
|
|
|
|
cp -f godot-api/extension_api.json godot-cpp/gdextension/
|
|
|
|
|
2024-05-17 09:28:56 +02:00
|
|
|
# TODO: Add caching to the SCons build and store it for CI via the godot-cache
|
2023-08-01 20:38:07 +02:00
|
|
|
# action.
|
|
|
|
|
|
|
|
# Build godot-cpp test extension
|
|
|
|
- name: Build godot-cpp test extension
|
|
|
|
run: |
|
|
|
|
cd godot-cpp/test
|
|
|
|
scons target=template_debug dev_build=yes
|
|
|
|
cd ../..
|
2024-08-31 21:53:15 +02:00
|
|
|
|
|
|
|
gdextension-c-compile:
|
2024-07-08 17:41:20 +02:00
|
|
|
runs-on: 'ubuntu-20.04'
|
|
|
|
name: 'Check GDExtension header with a C compiler'
|
2024-08-31 21:53:15 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2024-07-08 17:41:20 +02:00
|
|
|
- name: 'Run C compiler on gdextension_interface.h'
|
2024-08-31 21:53:15 +02:00
|
|
|
run: |
|
|
|
|
gcc -c core/extension/gdextension_interface.h
|