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 c6ded8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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 }} --copy-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
15 changes: 13 additions & 2 deletions tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ 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, copy_gdextension_api: bool
) -> None:
print(
f"{YELLOW}{test_dir.name}: Create&populate test workdir in {test_workdir}{NO_COLOR}",
flush=True,
Expand All @@ -123,7 +125,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 copy_gdextension_api:
shutil.copytree(build_dir / "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 @@ -236,6 +241,11 @@ def run_test(
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("tests", nargs="*", help="Filter the tests to run")
parser.add_argument(
"--copy-gdextension-api",
action="store_true",
help="Copy GDExtension API folder instead of symlink (useful if you have issues on Windows)",
)
parser.add_argument(
"--build-dir",
type=Path,
Expand Down Expand Up @@ -312,5 +322,6 @@ def test_workdir_factory():
test_dir=test_dir,
distrib_workdir=distrib_workdir,
test_workdir=test_workdir,
copy_gdextension_api=args.copy_gdextension_api,
)
run_test(test_dir.name, test_workdir, godot_binary_path, godot_extra_args)

0 comments on commit c6ded8a

Please sign in to comment.