Skip to content

Commit

Permalink
Force copy of GDExtension API headers on Windows CI (avoid weird repa…
Browse files Browse the repository at this point in the history
…rse point on reparse point error)
  • Loading branch information
touilleMan committed Oct 18, 2023
1 parent 1538f09 commit 603c363
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
shell: bash
run: |
set -eux
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} -- --headless"
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} --custom-gdextension-api=./gdextension_api -- --headless"
python tests/run.py 0-gdscript $ARGS
python tests/run.py 1-gdextension $ARGS
python tests/run.py 2-pythonscript-init $ARGS
Expand Down
20 changes: 17 additions & 3 deletions tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import platform
import importlib.util
from typing import List, Sequence
from typing import List, Sequence, Optional
from contextlib import contextmanager
import argparse
from pathlib import Path
Expand Down Expand Up @@ -114,7 +114,12 @@ def symlink(src: Path, dst: Path) -> None:
os.symlink(str(src.resolve()), str(dst.resolve()))


def create_test_workdir(test_dir: Path, distrib_workdir: Path, test_workdir: Path) -> None:
def create_test_workdir(
test_dir: Path,
distrib_workdir: Path,
test_workdir: Path,
custom_gdextension_api: Optional[Path],
) -> None:
print(
f"{YELLOW}{test_dir.name}: Create&populate test workdir in {test_workdir}{NO_COLOR}",
flush=True,
Expand All @@ -123,7 +128,10 @@ def create_test_workdir(test_dir: Path, distrib_workdir: Path, test_workdir: Pat
symlink(distrib_workdir / "addons", test_workdir / "addons")
shutil.copy(distrib_workdir / "pythonscript.gdextension", test_workdir)
# GDExtension headers are needed to compile Cython modules
symlink(build_dir / "gdextension_api", test_workdir / "gdextension_api")
if custom_gdextension_api:
shutil.copytree(custom_gdextension_api, test_workdir / "gdextension_api")
else:
symlink(build_dir / "gdextension_api", test_workdir / "gdextension_api")

build_script = test_workdir / "build.py"
if build_script.exists():
Expand Down Expand Up @@ -262,6 +270,11 @@ def run_test(
action="store_true",
help="Only update the addons build symlinked into all test projects",
)
parser.add_argument(
"--custom-gdextension-api",
type=Path,
help="Copy GDExtension API folder from there instead of symlink the build one (useful if you have issues on Windows)",
)

try:
options_separator = sys.argv.index("--")
Expand Down Expand Up @@ -312,5 +325,6 @@ def test_workdir_factory():
test_dir=test_dir,
distrib_workdir=distrib_workdir,
test_workdir=test_workdir,
custom_gdextension_api=args.custom_gdextension_api,
)
run_test(test_dir.name, test_workdir, godot_binary_path, godot_extra_args)

0 comments on commit 603c363

Please sign in to comment.