[CI] Re-add generated files consistency check
parent
c4f1abe3f9
commit
0cfe01eff2
|
@ -32,3 +32,7 @@ jobs:
|
||||||
uses: pre-commit/action@v3.0.1
|
uses: pre-commit/action@v3.0.1
|
||||||
with:
|
with:
|
||||||
extra_args: --verbose --hook-stage manual --files ${{ env.CHANGED_FILES }}
|
extra_args: --verbose --hook-stage manual --files ${{ env.CHANGED_FILES }}
|
||||||
|
|
||||||
|
- name: Check generated files consistency
|
||||||
|
run:
|
||||||
|
python misc/scripts/check_get_file_list.py
|
||||||
|
|
|
@ -6,26 +6,40 @@ from pathlib import Path
|
||||||
|
|
||||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", ".."))
|
sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||||
|
|
||||||
from binding_generator import generate_bindings, get_file_list
|
from binding_generator import _generate_bindings, _get_file_list
|
||||||
|
from build_profile import generate_trimmed_api
|
||||||
|
|
||||||
api_filepath = "gdextension/extension_api.json"
|
api_filepath = "gdextension/extension_api.json"
|
||||||
bits = "64"
|
bits = "64"
|
||||||
precision = "single"
|
precision = "single"
|
||||||
output_dir = "self_test"
|
output_dir = "self_test"
|
||||||
|
|
||||||
generate_bindings(api_filepath, use_template_get_node=False, bits=bits, precision=precision, output_dir=output_dir)
|
|
||||||
flist = get_file_list(api_filepath, output_dir, headers=True, sources=True)
|
|
||||||
|
|
||||||
p = Path(output_dir) / "gen"
|
def test(profile_filepath=""):
|
||||||
allfiles = [str(f.as_posix()) for f in p.glob("**/*.*")]
|
api = generate_trimmed_api(api_filepath, profile_filepath)
|
||||||
missing = list(filter((lambda f: f not in flist), allfiles))
|
_generate_bindings(
|
||||||
extras = list(filter((lambda f: f not in allfiles), flist))
|
api,
|
||||||
if len(missing) > 0 or len(extras) > 0:
|
use_template_get_node=False,
|
||||||
print("Error!")
|
bits=bits,
|
||||||
for f in missing:
|
precision=precision,
|
||||||
print("MISSING: " + str(f))
|
output_dir=output_dir,
|
||||||
for f in extras:
|
)
|
||||||
print("EXTRA: " + str(f))
|
flist = _get_file_list(api, output_dir, headers=True, sources=True)
|
||||||
sys.exit(1)
|
|
||||||
else:
|
p = Path(output_dir) / "gen"
|
||||||
print("OK!")
|
allfiles = [str(f.as_posix()) for f in p.glob("**/*.*")]
|
||||||
|
missing = list(filter((lambda f: f not in flist), allfiles))
|
||||||
|
extras = list(filter((lambda f: f not in allfiles), flist))
|
||||||
|
if len(missing) > 0 or len(extras) > 0:
|
||||||
|
print("Error!")
|
||||||
|
for f in missing:
|
||||||
|
print("MISSING: " + str(f))
|
||||||
|
for f in extras:
|
||||||
|
print("EXTRA: " + str(f))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
print("OK!")
|
||||||
|
|
||||||
|
|
||||||
|
test()
|
||||||
|
test("test/build_profile.json")
|
||||||
|
|
Loading…
Reference in New Issue