-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support new GDExtensionInterfaceGetProcAddress based GDExtension inte…
…rface
- Loading branch information
1 parent
c03cc3a
commit 1632506
Showing
15 changed files
with
656 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,16 @@ on: | |
- godot4-meson | ||
|
||
|
||
# Cancel run if another commit is pushed on the branch | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
# Global Settings | ||
env: | ||
PYTHON_VERSION: "3.8" # Python to run the build, no the one shipped ! | ||
BLEEDING_EDGE_GODOT: true | ||
|
||
|
||
jobs: | ||
|
@@ -50,34 +57,79 @@ jobs: | |
LD: lld | ||
PLATFORM: linux-x86_64 | ||
steps: | ||
|
||
- name: 'Checkout' | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected] | ||
with: | ||
submodules: true | ||
|
||
- name: 'Set up Python' | ||
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: 'Setup venv' | ||
run: | | ||
set -eux | ||
${{ env.CC }} --version | ||
python --version | ||
pip install -U pip | ||
pip install -r requirements.in | ||
- name: Download bleeding edge Godot 🏗️ | ||
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9 | ||
if: ${{ env.BLEEDING_EDGE_GODOT }} | ||
with: | ||
repo: godotengine/godot | ||
branch: master | ||
event: push | ||
workflow: linux_builds.yml | ||
workflow_conclusion: success | ||
name: linux-editor-mono | ||
search_artifacts: true | ||
check_artifacts: true | ||
ensure_latest: true | ||
path: godot-artifacts | ||
|
||
- name: 'Setup bleeding edge Godot 🏗️' | ||
id: setup-godot | ||
if: ${{ env.BLEEDING_EDGE_GODOT }} | ||
run: | | ||
set -eux | ||
GODOT_BIN=./godot-artifacts/godot.linuxbsd.editor.x86_64.mono | ||
GDEXTENSION_DIR=./gdextension_api | ||
ls godot-artifacts | ||
chmod +x $GODOT_BIN | ||
$GODOT_BIN --headless --version | ||
mkdir $GDEXTENSION_DIR && pushd $GDEXTENSION_DIR | ||
$GODOT_BIN --headless --dump-extension-api | ||
mkdir godot && pushd godot | ||
$GODOT_BIN --headless --dump-gdextension-interface | ||
popd && popd | ||
echo "EXTRA_MESON_SETUP_ARGS='-D gdextension_path=$GDEXTENSION_DIR'" >> $GITHUB_OUTPUT | ||
echo "EXTRA_RUN_TESTS_ARGS='--godot-binary=$GODOT_BIN'" >> $GITHUB_OUTPUT | ||
- name: 'Setup project' | ||
run: python .github/scripts/meson_setup_or_dump_log.py build/ | ||
run: python .github/scripts/meson_setup_or_dump_log.py build/ ${{ steps.setup-godot.outputs.EXTRA_MESON_SETUP_ARGS }} | ||
|
||
- name: 'Build project' | ||
run: meson compile -C build/ | ||
- name: 'Run tests' | ||
run: | | ||
set -eux | ||
python tests/run.py 0-gdscript --build-dir build/ -- --headless | ||
python tests/run.py 1-gdextension --build-dir build/ -- --headless | ||
python tests/run.py 2-pythonscript-init --build-dir build/ -- --headless | ||
python tests/run.py 3-pythonscript-cython-only --build-dir build/ -- --headless | ||
ARGS=--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} -- --headless | ||
python tests/run.py 0-gdscript $ARGS | ||
python tests/run.py 1-gdextension $ARGS | ||
python tests/run.py 2-pythonscript-init $ARGS | ||
python tests/run.py 3-pythonscript-cython-only $ARGS | ||
# - name: 'Generate artifact archive' | ||
# run: meson compile -C build/ release | ||
|
||
# - name: 'Export release artifact' | ||
# uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2 | ||
# with: | ||
|
@@ -94,35 +146,81 @@ jobs: | |
env: | ||
PLATFORM: 'windows-x86_64' | ||
steps: | ||
|
||
- name: 'Checkout' | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected] | ||
with: | ||
submodules: true | ||
|
||
- name: 'Set up MSVC' | ||
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # [email protected] | ||
|
||
- name: 'Set up Python' | ||
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: 'Setup venv' | ||
shell: bash | ||
run: | | ||
set -eux | ||
python --version | ||
pip install -U pip | ||
pip install -r requirements.in | ||
- name: Download bleeding edge Godot 🏗️ | ||
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9 | ||
if: ${{ env.BLEEDING_EDGE_GODOT }} | ||
with: | ||
repo: godotengine/godot | ||
branch: master | ||
event: push | ||
workflow: windows_builds.yml | ||
workflow_conclusion: success | ||
name: windows-editor | ||
search_artifacts: true | ||
check_artifacts: true | ||
ensure_latest: true | ||
path: godot-artifacts | ||
|
||
- name: 'Setup bleeding edge Godot 🏗️' | ||
id: setup-godot | ||
if: ${{ env.BLEEDING_EDGE_GODOT }} | ||
run: | | ||
set -eux | ||
GODOT_BIN=./godot-artifacts/godot.windows.editor.x86_64.mono | ||
GDEXTENSION_DIR=./gdextension_api | ||
ls godot-artifacts | ||
chmod +x $GODOT_BIN | ||
$GODOT_BIN --headless --version | ||
mkdir $GDEXTENSION_DIR && pushd $GDEXTENSION_DIR | ||
$GODOT_BIN --headless --dump-extension-api | ||
mkdir godot && pushd godot | ||
$GODOT_BIN --headless --dump-gdextension-interface | ||
popd && popd | ||
echo "EXTRA_MESON_SETUP_ARGS='-D gdextension_path=$GDEXTENSION_DIR'" >> $GITHUB_OUTPUT | ||
echo "EXTRA_RUN_TESTS_ARGS='--godot-binary=$GODOT_BIN'" >> $GITHUB_OUTPUT | ||
- name: 'Setup project' | ||
run: python .github/scripts/meson_setup_or_dump_log.py build/ | ||
run: python .github/scripts/meson_setup_or_dump_log.py build/ ${{ steps.setup-godot.outputs.EXTRA_MESON_SETUP_ARGS }} | ||
|
||
- name: 'Build project' | ||
run: meson compile -C build/ | ||
|
||
- name: 'Run tests' | ||
shell: bash | ||
run: | | ||
set -eux | ||
python tests/run.py 0-gdscript --build-dir build/ -- --headless | ||
python tests/run.py 1-gdextension --build-dir build/ -- --headless | ||
python tests/run.py 2-pythonscript-init --build-dir build/ -- --headless | ||
python tests/run.py 3-pythonscript-cython-only --build-dir build/ -- --headless | ||
ARGS=--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} -- --headless | ||
python tests/run.py 0-gdscript $ARGS | ||
python tests/run.py 1-gdextension $ARGS | ||
python tests/run.py 2-pythonscript-init $ARGS | ||
python tests/run.py 3-pythonscript-cython-only $ARGS | ||
# - name: 'Install Mesa3D OpenGL' | ||
# shell: bash | ||
# run: | | ||
|
@@ -140,10 +238,13 @@ jobs: | |
# 7z.exe x mesa.7z | ||
# ls -lh opengl32.dll # Sanity check | ||
# popd | ||
|
||
# - name: 'Run tests' | ||
# run: python tests/run.py --build-dir build/ --godot-binary ${{ GODOT_BINARY_VERSION }} | ||
|
||
# - name: 'Generate artifact archive' | ||
# run: meson compile -C build/ release | ||
|
||
# - name: 'Export release artifact' | ||
# uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2 | ||
# with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[configuration] | ||
|
||
entry_symbol = "pythonscript_init" | ||
compatibility_minimum = "4.1" | ||
|
||
[libraries] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
|
||
|
||
def symlink(src, dst): | ||
try: | ||
os.unlink(dst) | ||
except Exception: | ||
pass | ||
|
||
if sys.platform == "win32": | ||
try: | ||
import _winapi | ||
|
||
_winapi.CreateJunction(src, dst) | ||
except Exception as e: | ||
raise SystemExit( | ||
f"Can't do a NTFS junction as symlink fallback ({src} -> {dst})" | ||
) from e | ||
|
||
else: | ||
try: | ||
os.symlink(src, dst) | ||
except Exception as e: | ||
raise SystemExit(f"Can't create symlink ({src} -> {dst})") from e | ||
|
||
|
||
USAGE = "usage: symlink.py SRC1 SRC2 ... DST1 DST2 ..." | ||
|
||
|
||
srcs_and_dsts = sys.argv[1:] | ||
srcs = srcs_and_dsts[: len(srcs_and_dsts) // 2] | ||
dsts = srcs_and_dsts[len(srcs_and_dsts) // 2 :] | ||
|
||
|
||
if len(srcs) != len(dsts): | ||
raise SystemExit(USAGE) | ||
|
||
|
||
for src, dst in zip(srcs, dsts): | ||
symlink(src, dst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.