Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
touilleMan committed Mar 26, 2023
1 parent f91e49b commit ad876a4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
65 changes: 31 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ jobs:
python --version
pip install -U pip
pip install -r requirements.in
- name: 'Sanity check on extension_api_parser'
run: python -m scripts.extension_api_parser
- name: 'Setup project'
run: python .github/scripts/meson_setup_or_dump_log.py build/
- name: 'Build project'
Expand Down Expand Up @@ -98,11 +96,9 @@ jobs:
- PLATFORM: 'windows-x86_64'
PYTHON_ARCH: 'x64'
MSVC_ARCH: 'x64'
GODOT_BINARY_HINT: ''
- PLATFORM: 'windows-x86'
PYTHON_ARCH: 'x86'
MSVC_ARCH: 'x86'
GODOT_BINARY_HINT: 'x86:'
steps:
- name: 'Checkout'
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
Expand Down Expand Up @@ -132,9 +128,9 @@ jobs:
shell: bash
run: |
set -eux
python tests/run.py 0-gdscript --build-dir build/ --godot-binary=${{ matrix.GODOT_BINARY_HINT }} -- --headless
python tests/run.py 1-gdextension --build-dir build/ --godot-binary=${{ matrix.GODOT_BINARY_HINT }} -- --headless
python tests/run.py 2-pythonscript-init --build-dir build/ --godot-binary=${{ matrix.GODOT_BINARY_HINT }} -- --headless
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
# - name: 'Install Mesa3D OpenGL'
# shell: bash
# run: |
Expand Down Expand Up @@ -166,33 +162,34 @@ jobs:
#################################################################################


macos-build:
name: '🍎 macOS build'
runs-on: macos-latest
env:
CC: clang
LD: lld
PLATFORM: 'macos-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.txt
- name: 'Setup project'
run: python .github/scripts/meson_setup_or_dump_log.py build/
- name: 'Build project'
run: meson compile -C build/
# TODO
# macos-build:
# name: '🍎 macOS build'
# runs-on: macos-latest
# env:
# CC: clang
# LD: lld
# PLATFORM: 'macos-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.txt
# - name: 'Setup project'
# run: python .github/scripts/meson_setup_or_dump_log.py build/
# - name: 'Build project'
# run: meson compile -C build/
# TODO: see https://github.com/touilleMan/godot-python/issues/358
# - name: 'Run tests'
# run: python tests/run.py 0-pythonscript-init --build-dir build/ -- --headless
Expand Down
13 changes: 11 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,29 @@ if get_option('gdextension_path') != ''
gdextension_path = join_paths(meson.project_source_root(), get_option('gdextension_path'))
else
# Download Godot and generate it GDextension API
message('Fetching Godot v@0@ binary and generating GDExtension...'.format(get_option('godot_version')))
run_command(
python,
'scripts/fetch_godot.py',
'--generate-gdextension',
'--build-dir', meson.project_build_root(),
get_option('godot_version'),
capture: true,
check: true,
).stdout().strip().split('\n')
)
gdextension_path = join_paths(meson.project_build_root(), 'gdextension_api')
endif


godot_extension_api_json = join_paths(gdextension_path, 'extension_api.json')
# Sanity check on extension_api_parser
message('Checking GDExtension\'s extension_api.json is supported...'.format(get_option('godot_version')))
run_command(
python,
'-m',
'scripts.extension_api_parser',
godot_extension_api_json,
check: true,
)


# On Windows `/MDd` flag (used by meson when `buildtype=debug`) defines `_DEBUG`,
Expand Down
8 changes: 2 additions & 6 deletions scripts/extension_api_parser/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
try:
extension_api_path = Path(sys.argv[1])
except IndexError:
extension_api_path = (
(Path(__file__).parent / "../../godot_headers/extension_api.json")
.resolve()
.relative_to(os.getcwd())
)
raise SystemExit("Usage: python -m extension_api_parser <path/to/extension_api.json>")


try:
Expand All @@ -29,6 +25,6 @@
for build_config in build_configs:
initial_types_db = TYPES_DB.copy()
print(f"Checking {extension_api_path} with config {build_config.value}")
parse_extension_api_json(extension_api_path, build_config, skip_classes=False)
parse_extension_api_json(extension_api_path, build_config, filter_classes=False)
TYPES_DB.clear()
TYPES_DB.update(initial_types_db)

0 comments on commit ad876a4

Please sign in to comment.