mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
CI: Sync configuration with 4.4 branch
Includes cherry-pick of warning fixes from8d1462c748and template builds unit tests fixes from17929a3443. Also a Windows MSVC detection fix for SCons 4.6.0+ fromf682406cf2.
This commit is contained in:
parent
e7d56e32fd
commit
76b1b33604
32 changed files with 473 additions and 296 deletions
10
.github/actions/download-artifact/action.yml
vendored
10
.github/actions/download-artifact/action.yml
vendored
|
|
@ -1,18 +1,20 @@
|
||||||
name: Download Godot artifact
|
name: Download Godot artifact
|
||||||
description: Download the Godot artifact.
|
description: Download the Godot artifact.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
description: The artifact name.
|
description: The artifact name.
|
||||||
default: "${{ github.job }}"
|
default: ${{ github.job }}
|
||||||
path:
|
path:
|
||||||
description: The path to download and extract to.
|
description: The path to download and extract to.
|
||||||
required: true
|
required: true
|
||||||
default: "./"
|
default: ./
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Download Godot Artifact
|
- name: Download Godot Artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.name }}
|
name: ${{ inputs.name }}
|
||||||
path: ${{ inputs.path }}
|
path: ${{ inputs.path }}
|
||||||
|
|
|
||||||
24
.github/actions/godot-api-dump/action.yml
vendored
24
.github/actions/godot-api-dump/action.yml
vendored
|
|
@ -1,24 +0,0 @@
|
||||||
name: Dump Godot API
|
|
||||||
description: Dump Godot API for GDExtension
|
|
||||||
inputs:
|
|
||||||
bin:
|
|
||||||
description: The path to the Godot executable
|
|
||||||
required: true
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
# Dump GDExtension interface and API
|
|
||||||
- name: Dump GDExtension interface and API for godot-cpp build
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api
|
|
||||||
mkdir godot-api
|
|
||||||
cp -f gdextension_interface.h godot-api/
|
|
||||||
cp -f extension_api.json godot-api/
|
|
||||||
|
|
||||||
- name: Upload API dump
|
|
||||||
uses: ./.github/actions/upload-artifact
|
|
||||||
with:
|
|
||||||
name: 'godot-api-dump'
|
|
||||||
path: './godot-api/*'
|
|
||||||
|
|
||||||
30
.github/actions/godot-build/action.yml
vendored
30
.github/actions/godot-build/action.yml
vendored
|
|
@ -1,29 +1,33 @@
|
||||||
name: Build Godot
|
name: Build Godot
|
||||||
description: Build Godot with the provided options.
|
description: Build Godot with the provided options.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
target:
|
target:
|
||||||
description: Build target (editor, template_release, template_debug).
|
description: Build target (editor, template_release, template_debug).
|
||||||
default: "editor"
|
default: editor
|
||||||
tests:
|
tests:
|
||||||
description: Unit tests.
|
description: Unit tests.
|
||||||
default: false
|
default: false
|
||||||
|
required: false
|
||||||
platform:
|
platform:
|
||||||
description: Target platform.
|
description: Target platform.
|
||||||
required: false
|
required: false
|
||||||
sconsflags:
|
sconsflags:
|
||||||
|
description: Additional SCons flags.
|
||||||
default: ""
|
default: ""
|
||||||
|
required: false
|
||||||
scons-cache:
|
scons-cache:
|
||||||
description: The scons cache path.
|
description: The SCons cache path.
|
||||||
default: "${{ github.workspace }}/.scons-cache/"
|
default: ${{ github.workspace }}/.scons_cache/
|
||||||
scons-cache-limit:
|
scons-cache-limit:
|
||||||
description: The scons cache size limit.
|
description: The SCons cache size limit.
|
||||||
# actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
|
# actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
|
||||||
# Limit to 7 GiB to avoid having the extracted cache fill the disk.
|
# Limit to 7 GiB to avoid having the extracted cache fill the disk.
|
||||||
default: 7168
|
default: 7168
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Scons Build
|
- name: SCons Build
|
||||||
shell: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
SCONSFLAGS: ${{ inputs.sconsflags }}
|
SCONSFLAGS: ${{ inputs.sconsflags }}
|
||||||
|
|
@ -31,6 +35,18 @@ runs:
|
||||||
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
|
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
|
||||||
run: |
|
run: |
|
||||||
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
||||||
if [ "${{ inputs.target }}" != "editor" ]; then rm -rf editor; fi # Ensure we don't include editor code.
|
|
||||||
|
if [ "${{ inputs.target }}" != "editor" ]; then
|
||||||
|
# Ensure we don't include editor code in export template builds.
|
||||||
|
rm -rf editor
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${{ github.event.number }}" != "" ]; then
|
||||||
|
# Set build identifier with pull request number if available. This is displayed throughout the editor.
|
||||||
|
export BUILD_NAME="gh-${{ github.event.number }}"
|
||||||
|
else
|
||||||
|
export BUILD_NAME="gh"
|
||||||
|
fi
|
||||||
|
|
||||||
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
||||||
ls -l bin/
|
ls -l bin/
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
name: Setup Godot build cache
|
name: Restore Godot build cache
|
||||||
description: Setup Godot build cache.
|
description: Restore Godot build cache.
|
||||||
inputs:
|
inputs:
|
||||||
cache-name:
|
cache-name:
|
||||||
description: The cache base name (job name by default).
|
description: The cache base name (job name by default).
|
||||||
default: "${{github.job}}"
|
default: ${{ github.job }}
|
||||||
scons-cache:
|
scons-cache:
|
||||||
description: The scons cache path.
|
description: The SCons cache path.
|
||||||
default: "${{github.workspace}}/.scons-cache/"
|
default: ${{ github.workspace }}/.scons_cache/
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
# Upload cache on completion and check it out now
|
- name: Restore SCons cache directory
|
||||||
- name: Load .scons_cache directory
|
uses: actions/cache/restore@v4
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.scons-cache }}
|
path: ${{ inputs.scons-cache }}
|
||||||
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
||||||
18
.github/actions/godot-cache-save/action.yml
vendored
Normal file
18
.github/actions/godot-cache-save/action.yml
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
name: Save Godot build cache
|
||||||
|
description: Save Godot build cache.
|
||||||
|
inputs:
|
||||||
|
cache-name:
|
||||||
|
description: The cache base name (job name by default).
|
||||||
|
default: ${{ github.job }}
|
||||||
|
scons-cache:
|
||||||
|
description: The SCons cache path.
|
||||||
|
default: ${{ github.workspace }}/.scons_cache/
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Save SCons cache directory
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.scons-cache }}
|
||||||
|
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
name: Test Godot project converter
|
name: Test Godot project converter
|
||||||
description: Test the Godot project converter.
|
description: Test the Godot project converter.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
bin:
|
bin:
|
||||||
description: The path to the Godot executable
|
description: The path to the Godot executable
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Test 3-to-4 conversion
|
- name: Test 3-to-4 conversion
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|
|
||||||
40
.github/actions/godot-cpp-build/action.yml
vendored
Normal file
40
.github/actions/godot-cpp-build/action.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
name: Build godot-cpp
|
||||||
|
description: Build godot-cpp with the provided options.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
bin:
|
||||||
|
description: Path to the Godot binary.
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
scons-flags:
|
||||||
|
description: Additional SCons flags.
|
||||||
|
type: string
|
||||||
|
scons-cache:
|
||||||
|
description: The SCons cache path.
|
||||||
|
default: ${{ github.workspace }}/.scons_cache/
|
||||||
|
type: string
|
||||||
|
godot-cpp-branch:
|
||||||
|
description: The godot-cpp branch.
|
||||||
|
default: master
|
||||||
|
type: string
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
repository: godotengine/godot-cpp
|
||||||
|
ref: ${{ inputs.godot-cpp-branch }}
|
||||||
|
path: godot-cpp
|
||||||
|
|
||||||
|
- name: Extract API
|
||||||
|
shell: sh
|
||||||
|
run: ${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api
|
||||||
|
|
||||||
|
- name: SCons Build
|
||||||
|
shell: sh
|
||||||
|
env:
|
||||||
|
SCONS_CACHE: ${{ inputs.scons-cache }}
|
||||||
|
run: scons --directory=./godot-cpp/test "gdextension_dir=${{ github.workspace }}" ${{ inputs.scons-flags }}
|
||||||
30
.github/actions/godot-deps/action.yml
vendored
30
.github/actions/godot-deps/action.yml
vendored
|
|
@ -1,27 +1,31 @@
|
||||||
name: Setup python and scons
|
name: Setup Python and SCons
|
||||||
description: Setup python, install the pip version of scons.
|
description: Setup Python, install the pip version of SCons.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
python-version:
|
python-version:
|
||||||
description: The python version to use.
|
description: The Python version to use.
|
||||||
default: "3.x"
|
default: 3.x
|
||||||
python-arch:
|
python-arch:
|
||||||
description: The python architecture.
|
description: The Python architecture.
|
||||||
default: "x64"
|
default: x64
|
||||||
|
scons-version:
|
||||||
|
description: The SCons version to use.
|
||||||
|
default: 4.8.1
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
# Use python 3.x release (works cross platform)
|
|
||||||
- name: Set up Python 3.x
|
- name: Set up Python 3.x
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
# Semantic version range syntax or exact version of a Python version
|
# Semantic version range syntax or exact version of a Python version.
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
# Optional - x64 or x86 architecture, defaults to x64
|
# Optional - x64 or x86 architecture, defaults to x64.
|
||||||
architecture: ${{ inputs.python-arch }}
|
architecture: ${{ inputs.python-arch }}
|
||||||
|
|
||||||
- name: Setup scons
|
- name: Setup SCons
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -c "import sys; print(sys.version)"
|
python -c "import sys; print(sys.version)"
|
||||||
python -m pip install scons==4.4.0
|
python -m pip install scons==${{ inputs.scons-version }}
|
||||||
scons --version
|
scons --version
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
name: Test Godot project
|
name: Test Godot project
|
||||||
description: Run the test Godot project.
|
description: Run the test Godot project.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
bin:
|
bin:
|
||||||
description: The path to the Godot executable
|
description: The path to the Godot executable
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
# Download and extract zip archive with project, folder is renamed to be able to easy change used project
|
# Download and extract zip archive with project, folder is renamed to be able to easy change used project
|
||||||
- name: Download test project
|
- name: Download test project
|
||||||
|
|
|
||||||
13
.github/actions/upload-artifact/action.yml
vendored
13
.github/actions/upload-artifact/action.yml
vendored
|
|
@ -1,19 +1,22 @@
|
||||||
name: Upload Godot artifact
|
name: Upload Godot artifact
|
||||||
description: Upload the Godot artifact.
|
description: Upload the Godot artifact.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
description: The artifact name.
|
description: The artifact name.
|
||||||
default: "${{ github.job }}"
|
default: ${{ github.job }}
|
||||||
path:
|
path:
|
||||||
description: The path to upload.
|
description: The path to upload.
|
||||||
required: true
|
required: true
|
||||||
default: "bin/*"
|
default: bin/*
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Upload Godot Artifact
|
- name: Upload Godot Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.name }}
|
name: ${{ inputs.name }}
|
||||||
path: ${{ inputs.path }}
|
path: ${{ inputs.path }}
|
||||||
retention-days: 14
|
# Default is 90 days.
|
||||||
|
retention-days: 60
|
||||||
|
|
|
||||||
82
.github/workflows/android_builds.yml
vendored
82
.github/workflows/android_builds.yml
vendored
|
|
@ -5,56 +5,88 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: "4.0"
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
android-template:
|
build-android:
|
||||||
runs-on: "ubuntu-20.04"
|
runs-on: ubuntu-24.04
|
||||||
name: Template (target=template_release)
|
name: ${{ matrix.name }}
|
||||||
|
timeout-minutes: 60
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Editor (target=editor)
|
||||||
|
cache-name: android-editor
|
||||||
|
target: editor
|
||||||
|
tests: false
|
||||||
|
sconsflags: arch=arm64 production=yes
|
||||||
|
|
||||||
|
- name: Template arm32 (target=template_release, arch=arm32)
|
||||||
|
cache-name: android-template-arm32
|
||||||
|
target: template_release
|
||||||
|
tests: false
|
||||||
|
sconsflags: arch=arm32
|
||||||
|
|
||||||
|
- name: Template arm64 (target=template_release, arch=arm64)
|
||||||
|
cache-name: android-template-arm64
|
||||||
|
target: template_release
|
||||||
|
tests: false
|
||||||
|
sconsflags: arch=arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Java 11
|
- name: Set up Java 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 11
|
java-version: 17
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Compilation (arm32)
|
- name: Compilation
|
||||||
uses: ./.github/actions/godot-build
|
uses: ./.github/actions/godot-build
|
||||||
with:
|
with:
|
||||||
sconsflags: ${{ env.SCONSFLAGS }} arch=arm32
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
|
||||||
platform: android
|
platform: android
|
||||||
target: template_release
|
target: ${{ matrix.target }}
|
||||||
tests: false
|
tests: ${{ matrix.tests }}
|
||||||
|
|
||||||
- name: Compilation (arm64)
|
- name: Save Godot build cache
|
||||||
uses: ./.github/actions/godot-build
|
uses: ./.github/actions/godot-cache-save
|
||||||
with:
|
with:
|
||||||
sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
|
cache-name: ${{ matrix.cache-name }}
|
||||||
platform: android
|
continue-on-error: true
|
||||||
target: template_release
|
|
||||||
tests: false
|
|
||||||
|
|
||||||
- name: Generate Godot templates
|
- name: Generate Godot templates
|
||||||
|
if: matrix.target == 'template_release'
|
||||||
run: |
|
run: |
|
||||||
cd platform/android/java
|
cd platform/android/java
|
||||||
./gradlew generateGodotTemplates
|
./gradlew generateGodotTemplates
|
||||||
cd ../../..
|
cd ../../..
|
||||||
ls -l bin/
|
ls -l bin/
|
||||||
|
|
||||||
|
- name: Generate Godot editor
|
||||||
|
if: matrix.target == 'editor'
|
||||||
|
run: |
|
||||||
|
cd platform/android/java
|
||||||
|
./gradlew generateGodotEditor
|
||||||
|
cd ../../..
|
||||||
|
ls -l bin/android_editor_builds/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: ./.github/actions/upload-artifact
|
uses: ./.github/actions/upload-artifact
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.cache-name }}
|
||||||
|
|
|
||||||
54
.github/workflows/godot_cpp_test.yml
vendored
54
.github/workflows/godot_cpp_test.yml
vendored
|
|
@ -1,54 +0,0 @@
|
||||||
name: 🪲 Godot CPP
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
# Global Settings
|
|
||||||
env:
|
|
||||||
# Used for the cache key, and godot-cpp checkout. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-cpp-tests
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
godot-cpp-tests:
|
|
||||||
runs-on: "ubuntu-20.04"
|
|
||||||
name: "Build and test Godot CPP"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup python and scons
|
|
||||||
uses: ./.github/actions/godot-deps
|
|
||||||
|
|
||||||
# Checkout godot-cpp
|
|
||||||
- name: Checkout godot-cpp
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: godotengine/godot-cpp
|
|
||||||
ref: ${{ env.GODOT_BASE_BRANCH }}
|
|
||||||
submodules: 'recursive'
|
|
||||||
path: 'godot-cpp'
|
|
||||||
|
|
||||||
# Download generated API dump
|
|
||||||
- name: Download GDExtension interface and API dump
|
|
||||||
uses: ./.github/actions/download-artifact
|
|
||||||
with:
|
|
||||||
name: 'godot-api-dump'
|
|
||||||
path: './godot-api'
|
|
||||||
|
|
||||||
# Extract and override existing files with generated files
|
|
||||||
- name: Extract GDExtension interface and API dump
|
|
||||||
run: |
|
|
||||||
cp -f godot-api/gdextension_interface.h godot-cpp/gdextension/
|
|
||||||
cp -f godot-api/extension_api.json godot-cpp/gdextension/
|
|
||||||
|
|
||||||
# TODO: Add caching to the scons build and store it for CI via the godot-cache
|
|
||||||
# action.
|
|
||||||
|
|
||||||
# Build godot-cpp test extension
|
|
||||||
- name: Build godot-cpp test extension
|
|
||||||
run: |
|
|
||||||
cd godot-cpp/test
|
|
||||||
scons target=template_debug dev_build=yes
|
|
||||||
cd ../..
|
|
||||||
24
.github/workflows/ios_builds.yml
vendored
24
.github/workflows/ios_builds.yml
vendored
|
|
@ -5,26 +5,26 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: "4.0"
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ios
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ios-template:
|
ios-template:
|
||||||
runs-on: "macos-latest"
|
runs-on: macos-latest
|
||||||
name: Template (target=template_release)
|
name: Template (target=template_release)
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Compilation (arm64)
|
- name: Compilation (arm64)
|
||||||
|
|
@ -35,5 +35,9 @@ jobs:
|
||||||
target: template_release
|
target: template_release
|
||||||
tests: false
|
tests: false
|
||||||
|
|
||||||
|
- name: Save Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache-save
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: ./.github/actions/upload-artifact
|
uses: ./.github/actions/upload-artifact
|
||||||
|
|
|
||||||
124
.github/workflows/linux_builds.yml
vendored
124
.github/workflows/linux_builds.yml
vendored
|
|
@ -5,19 +5,18 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: "4.0"
|
||||||
|
GODOT_CPP_BRANCH: "4.0"
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
||||||
DOTNET_NOLOGO: true
|
DOTNET_NOLOGO: true
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: "ubuntu-20.04"
|
# Stay one LTS before latest to increase portability of Linux artifacts.
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -26,24 +25,24 @@ jobs:
|
||||||
cache-name: linux-editor-mono
|
cache-name: linux-editor-mono
|
||||||
target: editor
|
target: editor
|
||||||
sconsflags: module_mono_enabled=yes
|
sconsflags: module_mono_enabled=yes
|
||||||
bin: "./bin/godot.linuxbsd.editor.x86_64.mono"
|
bin: ./bin/godot.linuxbsd.editor.x86_64.mono
|
||||||
build-mono: true
|
build-mono: true
|
||||||
tests: false # Disabled due freeze caused by mix Mono build and CI
|
tests: false # Disabled due freeze caused by mix Mono build and CI
|
||||||
doc-test: true
|
doc-test: true
|
||||||
proj-conv: true
|
proj-conv: true
|
||||||
artifact: true
|
artifact: true
|
||||||
|
# Validate godot-cpp compatibility on one arbitrary editor build.
|
||||||
|
godot-cpp: true
|
||||||
|
|
||||||
- name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
|
- name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
|
||||||
cache-name: linux-editor-double-sanitizers
|
cache-name: linux-editor-double-sanitizers
|
||||||
target: editor
|
target: editor
|
||||||
# Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
|
# Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
|
||||||
sconsflags: dev_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold
|
sconsflags: dev_build=yes scu_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold
|
||||||
bin: "./bin/godot.linuxbsd.editor.dev.double.x86_64.san"
|
bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san
|
||||||
build-mono: false
|
build-mono: false
|
||||||
tests: true
|
tests: true
|
||||||
proj-test: true
|
proj-test: true
|
||||||
# Generate an API dump for godot-cpp tests.
|
|
||||||
api-dump: true
|
|
||||||
# Skip 2GiB artifact speeding up action.
|
# Skip 2GiB artifact speeding up action.
|
||||||
artifact: false
|
artifact: false
|
||||||
|
|
||||||
|
|
@ -51,16 +50,31 @@ jobs:
|
||||||
cache-name: linux-editor-llvm-sanitizers
|
cache-name: linux-editor-llvm-sanitizers
|
||||||
target: editor
|
target: editor
|
||||||
sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld
|
sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld
|
||||||
bin: "./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san"
|
bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
|
||||||
build-mono: false
|
build-mono: false
|
||||||
tests: true
|
tests: true
|
||||||
# Skip 2GiB artifact speeding up action.
|
# Skip 2GiB artifact speeding up action.
|
||||||
artifact: false
|
artifact: false
|
||||||
|
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
|
||||||
|
legacy-scons: true
|
||||||
|
|
||||||
- name: Template w/ Mono (target=template_release)
|
# Template builds need various fixes for unit tests to be supported in 4.0,
|
||||||
|
# so we don't enable tests in this legacy branch.
|
||||||
|
|
||||||
|
- name: Template w/ Mono, release (target=template_release)
|
||||||
cache-name: linux-template-mono
|
cache-name: linux-template-mono
|
||||||
target: template_release
|
target: template_release
|
||||||
sconsflags: module_mono_enabled=yes
|
sconsflags: module_mono_enabled=yes
|
||||||
|
bin: ./bin/godot.linuxbsd.template_release.x86_64.mono
|
||||||
|
build-mono: false
|
||||||
|
tests: false
|
||||||
|
artifact: true
|
||||||
|
|
||||||
|
- name: Template w/ Mono, debug (target=template_debug)
|
||||||
|
cache-name: linux-template-mono-debug
|
||||||
|
target: template_debug
|
||||||
|
sconsflags: module_mono_enabled=yes
|
||||||
|
bin: ./bin/godot.linuxbsd.template_debug.x86_64.mono
|
||||||
build-mono: false
|
build-mono: false
|
||||||
tests: false
|
tests: false
|
||||||
artifact: true
|
artifact: true
|
||||||
|
|
@ -69,18 +83,23 @@ jobs:
|
||||||
cache-name: linux-template-minimal
|
cache-name: linux-template-minimal
|
||||||
target: template_release
|
target: template_release
|
||||||
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no
|
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no
|
||||||
|
bin: ./bin/godot.linuxbsd.template_release.x86_64
|
||||||
tests: false
|
tests: false
|
||||||
artifact: true
|
artifact: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
# Need newer mesa for lavapipe to work properly.
|
# Need newer mesa for lavapipe to work properly.
|
||||||
- name: Linux dependencies for tests
|
- name: Linux dependencies for tests
|
||||||
if: ${{ matrix.proj-test }}
|
if: matrix.proj-test
|
||||||
run: |
|
run: |
|
||||||
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
|
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
|
||||||
sudo add-apt-repository ppa:kisak/kisak-mesa
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB8B81E14DA65431D7504EA8F63F0F2B90935439
|
||||||
|
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu jammy main"
|
||||||
sudo apt-get install -qq mesa-vulkan-drivers
|
sudo apt-get install -qq mesa-vulkan-drivers
|
||||||
|
|
||||||
- name: Free disk space on runner
|
- name: Free disk space on runner
|
||||||
|
|
@ -89,20 +108,35 @@ jobs:
|
||||||
sudo rm -rf /usr/local/lib/android
|
sudo rm -rf /usr/local/lib/android
|
||||||
echo "Disk usage after:" && df -h
|
echo "Disk usage after:" && df -h
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
with:
|
with:
|
||||||
cache-name: ${{ matrix.cache-name }}
|
cache-name: ${{ matrix.cache-name }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
|
if: "!matrix.legacy-scons"
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Set up .NET Sdk
|
- name: Setup Python and SCons (legacy versions)
|
||||||
uses: actions/setup-dotnet@v2
|
if: matrix.legacy-scons
|
||||||
if: ${{ matrix.build-mono }}
|
uses: ./.github/actions/godot-deps
|
||||||
with:
|
with:
|
||||||
dotnet-version: '6.0.x'
|
# Sync with Ensure*Version in SConstruct.
|
||||||
|
python-version: 3.8 # No Python < 3.8 available for Ubuntu 22.04.
|
||||||
|
scons-version: 3.1.2
|
||||||
|
|
||||||
|
- name: Force remove preinstalled .NET SDKs
|
||||||
|
if: matrix.build-mono
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet/sdk/*
|
||||||
|
|
||||||
|
- name: Setup older .NET SDK as baseline
|
||||||
|
if: matrix.build-mono
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
# Targeting the oldest version we want to support to ensure it still builds.
|
||||||
|
dotnet-version: 6.0.100
|
||||||
|
|
||||||
- name: Setup GCC problem matcher
|
- name: Setup GCC problem matcher
|
||||||
uses: ammaraskar/gcc-problem-matcher@master
|
uses: ammaraskar/gcc-problem-matcher@master
|
||||||
|
|
@ -115,45 +149,53 @@ jobs:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
tests: ${{ matrix.tests }}
|
tests: ${{ matrix.tests }}
|
||||||
|
|
||||||
|
- name: Compilation (godot-cpp)
|
||||||
|
uses: ./.github/actions/godot-cpp-build
|
||||||
|
if: matrix.godot-cpp
|
||||||
|
with:
|
||||||
|
bin: ${{ matrix.bin }}
|
||||||
|
scons-flags: target=template_debug dev_build=yes verbose=yes
|
||||||
|
godot-cpp-branch: ${{ env.GODOT_CPP_BRANCH }}
|
||||||
|
|
||||||
|
- name: Save Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache-save
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Generate C# glue
|
- name: Generate C# glue
|
||||||
if: ${{ matrix.build-mono }}
|
if: matrix.build-mono
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue || true
|
${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue
|
||||||
|
|
||||||
- name: Build .NET solutions
|
- name: Build .NET solutions
|
||||||
if: ${{ matrix.build-mono }}
|
if: matrix.build-mono
|
||||||
run: |
|
run: |
|
||||||
|
dotnet --info
|
||||||
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
|
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
if: ${{ matrix.artifact }}
|
if: matrix.artifact
|
||||||
run: |
|
run: |
|
||||||
strip bin/godot.*
|
strip bin/godot.*
|
||||||
chmod +x bin/godot.*
|
chmod +x bin/godot.*
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: ./.github/actions/upload-artifact
|
uses: ./.github/actions/upload-artifact
|
||||||
if: ${{ matrix.artifact }}
|
if: matrix.artifact
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.cache-name }}
|
name: ${{ matrix.cache-name }}
|
||||||
|
|
||||||
- name: Dump Godot API
|
|
||||||
uses: ./.github/actions/godot-api-dump
|
|
||||||
if: ${{ matrix.api-dump }}
|
|
||||||
with:
|
|
||||||
bin: ${{ matrix.bin }}
|
|
||||||
|
|
||||||
# Execute unit tests for the editor
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ matrix.tests }}
|
if: matrix.tests
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.bin }} --version
|
${{ matrix.bin }} --version
|
||||||
${{ matrix.bin }} --help
|
${{ matrix.bin }} --help
|
||||||
${{ matrix.bin }} --test --headless
|
${{ matrix.bin }} --headless --test
|
||||||
|
|
||||||
# Check class reference
|
# Check class reference
|
||||||
- name: Check for class reference updates
|
- name: Check for class reference updates
|
||||||
if: ${{ matrix.doc-test }}
|
if: matrix.doc-test
|
||||||
run: |
|
run: |
|
||||||
echo "Running --doctool to see if this changes the public API without updating the documentation."
|
echo "Running --doctool to see if this changes the public API without updating the documentation."
|
||||||
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
|
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
|
||||||
|
|
@ -163,13 +205,13 @@ jobs:
|
||||||
# Download and run the test project
|
# Download and run the test project
|
||||||
- name: Test Godot project
|
- name: Test Godot project
|
||||||
uses: ./.github/actions/godot-project-test
|
uses: ./.github/actions/godot-project-test
|
||||||
if: ${{ matrix.proj-test }}
|
if: matrix.proj-test
|
||||||
with:
|
with:
|
||||||
bin: ${{ matrix.bin }}
|
bin: ${{ matrix.bin }}
|
||||||
|
|
||||||
# Test the project converter
|
# Test the project converter
|
||||||
- name: Test project converter
|
- name: Test project converter
|
||||||
uses: ./.github/actions/godot-converter-test
|
uses: ./.github/actions/godot-converter-test
|
||||||
if: ${{ matrix.proj-conv }}
|
if: matrix.proj-conv
|
||||||
with:
|
with:
|
||||||
bin: ${{ matrix.bin }}
|
bin: ${{ matrix.bin }}
|
||||||
|
|
|
||||||
35
.github/workflows/macos_builds.yml
vendored
35
.github/workflows/macos_builds.yml
vendored
|
|
@ -5,17 +5,14 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: "4.0"
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: "macos-latest"
|
runs-on: macos-latest
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -24,29 +21,36 @@ jobs:
|
||||||
cache-name: macos-editor
|
cache-name: macos-editor
|
||||||
target: editor
|
target: editor
|
||||||
tests: true
|
tests: true
|
||||||
bin: "./bin/godot.macos.editor.universal"
|
bin: ./bin/godot.macos.editor.universal
|
||||||
|
|
||||||
|
# Template builds need various fixes for unit tests to be supported in 4.0,
|
||||||
|
# so we don't enable tests in this legacy branch.
|
||||||
|
|
||||||
- name: Template (target=template_release)
|
- name: Template (target=template_release)
|
||||||
cache-name: macos-template
|
cache-name: macos-template
|
||||||
target: template_release
|
target: template_release
|
||||||
tests: false
|
tests: false
|
||||||
sconsflags: debug_symbols=no
|
sconsflags: debug_symbols=no
|
||||||
|
bin: ./bin/godot.macos.template_release.universal
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Xcode
|
- name: Setup Xcode
|
||||||
uses: maxim-lobanov/setup-xcode@v1
|
uses: maxim-lobanov/setup-xcode@v1
|
||||||
with:
|
with:
|
||||||
xcode-version: '15.3'
|
xcode-version: '15.3'
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
with:
|
with:
|
||||||
cache-name: ${{ matrix.cache-name }}
|
cache-name: ${{ matrix.cache-name }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Setup Vulkan SDK
|
- name: Setup Vulkan SDK
|
||||||
|
|
@ -69,6 +73,12 @@ jobs:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
tests: ${{ matrix.tests }}
|
tests: ${{ matrix.tests }}
|
||||||
|
|
||||||
|
- name: Save Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache-save
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
run: |
|
run: |
|
||||||
lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal
|
lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal
|
||||||
|
|
@ -81,9 +91,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.cache-name }}
|
name: ${{ matrix.cache-name }}
|
||||||
|
|
||||||
# Execute unit tests for the editor
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ matrix.tests }}
|
if: matrix.tests
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.bin }} --version
|
${{ matrix.bin }} --version
|
||||||
${{ matrix.bin }} --help
|
${{ matrix.bin }} --help
|
||||||
|
|
|
||||||
17
.github/workflows/runner.yml
vendored
17
.github/workflows/runner.yml
vendored
|
|
@ -1,14 +1,15 @@
|
||||||
name: 🔗 GHA
|
name: 🔗 GHA
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, merge_group]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-runner
|
group: ${{ github.workflow }}|${{ github.ref_name }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# First stage: Only static checks, fast and prevent expensive builds from running.
|
# First stage: Only static checks, fast and prevent expensive builds from running.
|
||||||
|
|
||||||
static-checks:
|
static-checks:
|
||||||
|
if: "!vars.DISABLE_GODOT_CI"
|
||||||
name: 📊 Static checks
|
name: 📊 Static checks
|
||||||
uses: ./.github/workflows/static_checks.yml
|
uses: ./.github/workflows/static_checks.yml
|
||||||
|
|
||||||
|
|
@ -43,15 +44,3 @@ jobs:
|
||||||
name: 🌐 Web
|
name: 🌐 Web
|
||||||
needs: static-checks
|
needs: static-checks
|
||||||
uses: ./.github/workflows/web_builds.yml
|
uses: ./.github/workflows/web_builds.yml
|
||||||
|
|
||||||
# Third stage: Run auxiliary tests using build artifacts from previous jobs.
|
|
||||||
|
|
||||||
# Can be turned off for PRs that intentionally break compat with godot-cpp,
|
|
||||||
# until both the upstream PR and the matching godot-cpp changes are merged.
|
|
||||||
godot-cpp-test:
|
|
||||||
name: 🪲 Godot CPP
|
|
||||||
# This can be changed to depend on another platform, if we decide to use it for
|
|
||||||
# godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step
|
|
||||||
# appropriately.
|
|
||||||
needs: linux-build
|
|
||||||
uses: ./.github/workflows/godot_cpp_test.yml
|
|
||||||
|
|
|
||||||
30
.github/workflows/static_checks.yml
vendored
30
.github/workflows/static_checks.yml
vendored
|
|
@ -2,28 +2,25 @@ name: 📊 Static Checks
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-static
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
static-checks:
|
static-checks:
|
||||||
name: Code style, file formatting, and docs
|
name: Code style, file formatting, and docs
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Install APT dependencies
|
- name: Install APT dependencies
|
||||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
run: |
|
||||||
with:
|
sudo apt update
|
||||||
packages: dos2unix libxml2-utils moreutils
|
sudo apt install -y dos2unix libxml2-utils moreutils
|
||||||
|
|
||||||
- name: Install Python dependencies and general setup
|
- name: Install Python dependencies and general setup
|
||||||
run: |
|
run: |
|
||||||
pip3 install black==22.3.0 pytest==7.1.2 mypy==0.971
|
pip3 install black==23.3.0 pytest==7.1.2 mypy==0.971
|
||||||
git config diff.wsErrorHighlight all
|
git config diff.wsErrorHighlight all
|
||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
|
|
@ -32,13 +29,13 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||||
files=$(gh pr diff ${{ github.event.pull_request.number }} --name-only)
|
files=$(git diff-tree --no-commit-id --name-only -r HEAD^1..HEAD 2> /dev/null || true)
|
||||||
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then
|
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then
|
||||||
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true)
|
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true)
|
||||||
fi
|
fi
|
||||||
echo "$files" >> changed.txt
|
echo "$files" >> changed.txt
|
||||||
cat changed.txt
|
cat changed.txt
|
||||||
files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "./{}"' | tr '\n' ' ')
|
files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "\"./{}\""' | tr '\n' ' ')
|
||||||
echo "CHANGED_FILES=$files" >> $GITHUB_ENV
|
echo "CHANGED_FILES=$files" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: File formatting checks (file_format.sh)
|
- name: File formatting checks (file_format.sh)
|
||||||
|
|
@ -86,7 +83,8 @@ jobs:
|
||||||
|
|
||||||
- name: Documentation checks
|
- name: Documentation checks
|
||||||
run: |
|
run: |
|
||||||
doc/tools/make_rst.py --dry-run --color doc/classes modules
|
doc/tools/doc_status.py doc/classes modules/*/doc_classes platform/*/doc_classes
|
||||||
|
doc/tools/make_rst.py --dry-run --color doc/classes modules platform
|
||||||
|
|
||||||
- name: Style checks via clang-format (clang_format.sh)
|
- name: Style checks via clang-format (clang_format.sh)
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -106,5 +104,9 @@ jobs:
|
||||||
uses: codespell-project/actions-codespell@v2
|
uses: codespell-project/actions-codespell@v2
|
||||||
with:
|
with:
|
||||||
skip: "./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md,./core/input/gamecontrollerdb.txt,./core/string/locales.h,./editor/project_converter_3_to_4.cpp,./misc/scripts/codespell.sh,./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json"
|
skip: "./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md,./core/input/gamecontrollerdb.txt,./core/string/locales.h,./editor/project_converter_3_to_4.cpp,./misc/scripts/codespell.sh,./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json"
|
||||||
ignore_words_list: "curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,mis,nd,numer,ot,te,vai"
|
ignore_words_list: "breaked,checkin,curvelinear,doubleclick,expct,findn,gird,hel,inout,labelin,lod,mis,nd,numer,ot,pointin,requestor,te,textin,thirdparty,vai"
|
||||||
path: ${{ env.CHANGED_FILES }}
|
path: ${{ env.CHANGED_FILES }}
|
||||||
|
|
||||||
|
- name: Run C compiler on `gdextension_interface.h`
|
||||||
|
run: |
|
||||||
|
gcc -c core/extension/gdextension_interface.h
|
||||||
|
|
|
||||||
54
.github/workflows/web_builds.yml
vendored
54
.github/workflows/web_builds.yml
vendored
|
|
@ -5,47 +5,67 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: "4.0"
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no
|
||||||
EM_VERSION: 3.1.18
|
EM_VERSION: 3.1.18
|
||||||
EM_CACHE_FOLDER: "emsdk-cache"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-web
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
web-template:
|
web-template:
|
||||||
runs-on: "ubuntu-20.04"
|
runs-on: ubuntu-24.04
|
||||||
name: Template (target=template_release)
|
name: ${{ matrix.name }}
|
||||||
|
timeout-minutes: 60
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Template (target=template_release)
|
||||||
|
cache-name: web-template
|
||||||
|
target: template_release
|
||||||
|
sconsflags:
|
||||||
|
tests: false
|
||||||
|
artifact: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Emscripten latest
|
- name: Set up Emscripten latest
|
||||||
uses: mymindstorm/setup-emsdk@v12
|
uses: mymindstorm/setup-emsdk@v14
|
||||||
with:
|
with:
|
||||||
version: ${{ env.EM_VERSION }}
|
version: ${{ env.EM_VERSION }}
|
||||||
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
no-cache: true
|
||||||
|
|
||||||
- name: Verify Emscripten setup
|
- name: Verify Emscripten setup
|
||||||
run: |
|
run: |
|
||||||
emcc -v
|
emcc -v
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Compilation
|
- name: Compilation
|
||||||
uses: ./.github/actions/godot-build
|
uses: ./.github/actions/godot-build
|
||||||
with:
|
with:
|
||||||
sconsflags: ${{ env.SCONSFLAGS }}
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
|
||||||
platform: web
|
platform: web
|
||||||
target: template_release
|
target: ${{ matrix.target }}
|
||||||
tests: false
|
tests: ${{ matrix.tests }}
|
||||||
|
|
||||||
|
- name: Save Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache-save
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: ./.github/actions/upload-artifact
|
uses: ./.github/actions/upload-artifact
|
||||||
|
if: matrix.artifact
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.cache-name }}
|
||||||
|
|
|
||||||
48
.github/workflows/windows_builds.yml
vendored
48
.github/workflows/windows_builds.yml
vendored
|
|
@ -6,19 +6,16 @@ on:
|
||||||
# SCONS_CACHE for windows must be set in the build environment
|
# SCONS_CACHE for windows must be set in the build environment
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
# Used for the cache key. Add version suffix to force clean build.
|
||||||
GODOT_BASE_BRANCH: '4.0'
|
GODOT_BASE_BRANCH: 4.0
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
|
||||||
SCONS_CACHE_MSVC_CONFIG: true
|
SCONS_CACHE_MSVC_CONFIG: true
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
# Windows 10 with latest image
|
# Windows 10 with latest image
|
||||||
runs-on: "windows-latest"
|
runs-on: windows-latest
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -29,24 +26,42 @@ jobs:
|
||||||
tests: true
|
tests: true
|
||||||
# Skip debug symbols, they're way too big with MSVC.
|
# Skip debug symbols, they're way too big with MSVC.
|
||||||
sconsflags: debug_symbols=no vsproj=yes windows_subsystem=console
|
sconsflags: debug_symbols=no vsproj=yes windows_subsystem=console
|
||||||
bin: "./bin/godot.windows.editor.x86_64.exe"
|
bin: ./bin/godot.windows.editor.x86_64.exe
|
||||||
|
compiler: msvc
|
||||||
|
|
||||||
|
# Template builds need various fixes for unit tests to be supported in 4.0,
|
||||||
|
# so we don't enable tests in this legacy branch.
|
||||||
|
|
||||||
- name: Template (target=template_release)
|
- name: Template (target=template_release)
|
||||||
cache-name: windows-template
|
cache-name: windows-template
|
||||||
target: template_release
|
target: template_release
|
||||||
tests: false
|
tests: false
|
||||||
sconsflags: debug_symbols=no
|
sconsflags: debug_symbols=no
|
||||||
|
bin: ./bin/godot.windows.template_release.x86_64.console.exe
|
||||||
|
compiler: msvc
|
||||||
|
|
||||||
|
- name: Template w/ GCC (target=template_release, use_mingw=yes)
|
||||||
|
cache-name: windows-template-gcc
|
||||||
|
# MinGW takes MUCH longer to compile; save time by only targeting Template.
|
||||||
|
target: template_release
|
||||||
|
tests: false
|
||||||
|
sconsflags: debug_symbols=no use_mingw=yes
|
||||||
|
bin: ./bin/godot.windows.template_release.x86_64.console.exe
|
||||||
|
compiler: gcc
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Godot build cache
|
- name: Restore Godot build cache
|
||||||
uses: ./.github/actions/godot-cache
|
uses: ./.github/actions/godot-cache-restore
|
||||||
with:
|
with:
|
||||||
cache-name: ${{ matrix.cache-name }}
|
cache-name: ${{ matrix.cache-name }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Setup python and scons
|
- name: Setup Python and SCons
|
||||||
uses: ./.github/actions/godot-deps
|
uses: ./.github/actions/godot-deps
|
||||||
|
|
||||||
- name: Setup MSVC problem matcher
|
- name: Setup MSVC problem matcher
|
||||||
|
|
@ -60,18 +75,25 @@ jobs:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
tests: ${{ matrix.tests }}
|
tests: ${{ matrix.tests }}
|
||||||
|
|
||||||
|
- name: Save Godot build cache
|
||||||
|
uses: ./.github/actions/godot-cache-save
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
|
if: matrix.compiler == 'msvc'
|
||||||
run: |
|
run: |
|
||||||
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
|
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
|
if: matrix.compiler == 'msvc'
|
||||||
uses: ./.github/actions/upload-artifact
|
uses: ./.github/actions/upload-artifact
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.cache-name }}
|
name: ${{ matrix.cache-name }}
|
||||||
|
|
||||||
# Execute unit tests for the editor
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ matrix.tests }}
|
if: matrix.tests
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.bin }} --version
|
${{ matrix.bin }} --version
|
||||||
${{ matrix.bin }} --help
|
${{ matrix.bin }} --help
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
EnsureSConsVersion(3, 0, 0)
|
EnsureSConsVersion(3, 1, 2)
|
||||||
EnsurePythonVersion(3, 6)
|
EnsurePythonVersion(3, 6)
|
||||||
|
|
||||||
# System
|
# System
|
||||||
|
|
|
||||||
|
|
@ -662,15 +662,16 @@ PackedByteArray HTTPClientTCP::read_response_body_chunk() {
|
||||||
chunk_left -= rec;
|
chunk_left -= rec;
|
||||||
|
|
||||||
if (chunk_left == 0) {
|
if (chunk_left == 0) {
|
||||||
if (chunk[chunk.size() - 2] != '\r' || chunk[chunk.size() - 1] != '\n') {
|
const int chunk_size = chunk.size();
|
||||||
|
if (chunk[chunk_size - 2] != '\r' || chunk[chunk_size - 1] != '\n') {
|
||||||
ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)");
|
ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)");
|
||||||
status = STATUS_CONNECTION_ERROR;
|
status = STATUS_CONNECTION_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.resize(chunk.size() - 2);
|
ret.resize(chunk_size - 2);
|
||||||
uint8_t *w = ret.ptrw();
|
uint8_t *w = ret.ptrw();
|
||||||
memcpy(w, chunk.ptr(), chunk.size() - 2);
|
memcpy(w, chunk.ptr(), chunk_size - 2);
|
||||||
chunk.clear();
|
chunk.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3753,7 +3753,7 @@ void Image::fix_alpha_edges() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int closest_dist = max_dist;
|
int closest_dist = max_dist;
|
||||||
uint8_t closest_color[3];
|
uint8_t closest_color[3] = { 0 };
|
||||||
|
|
||||||
int from_x = MAX(0, j - max_radius);
|
int from_x = MAX(0, j - max_radius);
|
||||||
int to_x = MIN(width - 1, j + max_radius);
|
int to_x = MIN(width - 1, j + max_radius);
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,19 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
|
||||||
return ERR_UNAVAILABLE;
|
return ERR_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bogus GCC warning here:
|
||||||
|
* In member function 'int RingBuffer<T>::read(T*, int, bool) [with T = unsigned char]',
|
||||||
|
* inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:112:9,
|
||||||
|
* inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:99:7:
|
||||||
|
* Error: ./core/ring_buffer.h:68:46: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
|
||||||
|
* 68 | p_buf[dst++] = read[pos + i];
|
||||||
|
* | ~~~~~~~~~~~~~^~~~~~~
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
uint8_t ipv6[16];
|
uint8_t ipv6[16];
|
||||||
rb.read(ipv6, 16, true);
|
rb.read(ipv6, 16, true);
|
||||||
|
|
@ -115,6 +128,11 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
|
||||||
--queue_count;
|
--queue_count;
|
||||||
*r_buffer = packet_buffer;
|
*r_buffer = packet_buffer;
|
||||||
r_buffer_size = size;
|
r_buffer_size = size;
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -223,13 +223,13 @@ void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t StreamPeer::get_u8() {
|
uint8_t StreamPeer::get_u8() {
|
||||||
uint8_t buf[1];
|
uint8_t buf[1] = {};
|
||||||
get_data(buf, 1);
|
get_data(buf, 1);
|
||||||
return buf[0];
|
return buf[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t StreamPeer::get_8() {
|
int8_t StreamPeer::get_8() {
|
||||||
uint8_t buf[1];
|
uint8_t buf[1] = {};
|
||||||
get_data(buf, 1);
|
get_data(buf, 1);
|
||||||
return buf[0];
|
return buf[0];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -286,7 +286,7 @@ Error CowData<T>::resize(int p_size) {
|
||||||
if (current_size == 0) {
|
if (current_size == 0) {
|
||||||
// alloc from scratch
|
// alloc from scratch
|
||||||
uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true);
|
uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true);
|
||||||
ERR_FAIL_COND_V(!ptr, ERR_OUT_OF_MEMORY);
|
ERR_FAIL_NULL_V(ptr, ERR_OUT_OF_MEMORY);
|
||||||
*(ptr - 1) = 0; //size, currently none
|
*(ptr - 1) = 0; //size, currently none
|
||||||
new (ptr - 2) SafeNumeric<uint32_t>(1); //refcount
|
new (ptr - 2) SafeNumeric<uint32_t>(1); //refcount
|
||||||
|
|
||||||
|
|
@ -294,7 +294,7 @@ Error CowData<T>::resize(int p_size) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true);
|
uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true);
|
||||||
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
|
ERR_FAIL_NULL_V(_ptrnew, ERR_OUT_OF_MEMORY);
|
||||||
new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount
|
new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount
|
||||||
|
|
||||||
_ptr = (T *)(_ptrnew);
|
_ptr = (T *)(_ptrnew);
|
||||||
|
|
@ -324,7 +324,7 @@ Error CowData<T>::resize(int p_size) {
|
||||||
|
|
||||||
if (alloc_size != current_alloc_size) {
|
if (alloc_size != current_alloc_size) {
|
||||||
uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true);
|
uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true);
|
||||||
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
|
ERR_FAIL_NULL_V(_ptrnew, ERR_OUT_OF_MEMORY);
|
||||||
new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount
|
new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount
|
||||||
|
|
||||||
_ptr = (T *)(_ptrnew);
|
_ptr = (T *)(_ptrnew);
|
||||||
|
|
|
||||||
21
methods.py
21
methods.py
|
|
@ -667,25 +667,30 @@ def detect_visual_c_compiler_version(tools_env):
|
||||||
|
|
||||||
|
|
||||||
def find_visual_c_batch_file(env):
|
def find_visual_c_batch_file(env):
|
||||||
from SCons.Tool.MSCommon.vc import (
|
# TODO: We should investigate if we can avoid relying on SCons internals here.
|
||||||
get_default_version,
|
from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file, find_vc_pdir
|
||||||
get_host_target,
|
|
||||||
find_batch_file,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Syntax changed in SCons 4.4.0.
|
# Syntax changed in SCons 4.4.0.
|
||||||
from SCons import __version__ as scons_raw_version
|
from SCons import __version__ as scons_raw_version
|
||||||
|
|
||||||
scons_ver = env._get_major_minor_revision(scons_raw_version)
|
scons_ver = env._get_major_minor_revision(scons_raw_version)
|
||||||
|
|
||||||
version = get_default_version(env)
|
msvc_version = get_default_version(env)
|
||||||
|
|
||||||
if scons_ver >= (4, 4, 0):
|
if scons_ver >= (4, 4, 0):
|
||||||
(host_platform, target_platform, _) = get_host_target(env, version)
|
(host_platform, target_platform, _) = get_host_target(env, msvc_version)
|
||||||
else:
|
else:
|
||||||
(host_platform, target_platform, _) = get_host_target(env)
|
(host_platform, target_platform, _) = get_host_target(env)
|
||||||
|
|
||||||
return find_batch_file(env, version, host_platform, target_platform)[0]
|
if scons_ver < (4, 6, 0):
|
||||||
|
return find_batch_file(env, msvc_version, host_platform, target_platform)[0]
|
||||||
|
|
||||||
|
# SCons 4.6.0+ removed passing env, so we need to get the product_dir ourselves first,
|
||||||
|
# then pass that as the last param instead of env as the first param as before.
|
||||||
|
# Param names need to be explicit, as they were shuffled around in SCons 4.8.0.
|
||||||
|
product_dir = find_vc_pdir(msvc_version=msvc_version, env=env)
|
||||||
|
|
||||||
|
return find_batch_file(msvc_version, host_platform, target_platform, product_dir)[0]
|
||||||
|
|
||||||
|
|
||||||
def generate_cpp_hint_file(filename):
|
def generate_cpp_hint_file(filename):
|
||||||
|
|
|
||||||
|
|
@ -2929,7 +2929,8 @@ void TileMap::_set_tile_data(int p_layer, const Vector<int> &p_data) {
|
||||||
for (int i = 0; i < c; i += offset) {
|
for (int i = 0; i < c; i += offset) {
|
||||||
const uint8_t *ptr = (const uint8_t *)&r[i];
|
const uint8_t *ptr = (const uint8_t *)&r[i];
|
||||||
uint8_t local[12];
|
uint8_t local[12];
|
||||||
for (int j = 0; j < ((format >= FORMAT_2) ? 12 : 8); j++) {
|
const int buffer_size = (format >= FORMAT_2) ? 12 : 8;
|
||||||
|
for (int j = 0; j < buffer_size; j++) {
|
||||||
local[j] = ptr[j];
|
local[j] = ptr[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,12 +176,20 @@ TextureStorage::TextureStorage() {
|
||||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||||
|
|
||||||
|
// MinGW-GCC gets confused here, though it's clear it can't overflow unless `resize` hits OOM.
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
|
||||||
|
#endif
|
||||||
Vector<uint8_t> sv;
|
Vector<uint8_t> sv;
|
||||||
sv.resize(16 * 2);
|
sv.resize(16 * 2);
|
||||||
uint16_t *ptr = (uint16_t *)sv.ptrw();
|
uint16_t *ptr = (uint16_t *)sv.ptrw();
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
ptr[i] = Math::make_half_float(1.0f);
|
ptr[i] = Math::make_half_float(1.0f);
|
||||||
}
|
}
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
Vector<Vector<uint8_t>> vpv;
|
Vector<Vector<uint8_t>> vpv;
|
||||||
vpv.push_back(sv);
|
vpv.push_back(sv);
|
||||||
|
|
@ -450,12 +458,19 @@ TextureStorage::TextureStorage() {
|
||||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||||
tformat.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
tformat.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
|
||||||
|
#endif
|
||||||
Vector<uint8_t> sv;
|
Vector<uint8_t> sv;
|
||||||
sv.resize(16 * 2);
|
sv.resize(16 * 2);
|
||||||
uint16_t *ptr = (uint16_t *)sv.ptrw();
|
uint16_t *ptr = (uint16_t *)sv.ptrw();
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
ptr[i] = Math::make_half_float(1.0f);
|
ptr[i] = Math::make_half_float(1.0f);
|
||||||
}
|
}
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
Vector<Vector<uint8_t>> vsv;
|
Vector<Vector<uint8_t>> vsv;
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,6 @@ TEST_CASE("[Vector2] Plane methods") {
|
||||||
const Vector2 vector = Vector2(1.2, 3.4);
|
const Vector2 vector = Vector2(1.2, 3.4);
|
||||||
const Vector2 vector_y = Vector2(0, 1);
|
const Vector2 vector_y = Vector2(0, 1);
|
||||||
const Vector2 vector_normal = Vector2(0.95879811270838721622267, 0.2840883296913739899919);
|
const Vector2 vector_normal = Vector2(0.95879811270838721622267, 0.2840883296913739899919);
|
||||||
const Vector2 vector_non_normal = Vector2(5.4, 1.6);
|
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
vector.bounce(vector_y) == Vector2(1.2, -3.4),
|
vector.bounce(vector_y) == Vector2(1.2, -3.4),
|
||||||
"Vector2 bounce on a plane with normal of the Y axis should.");
|
"Vector2 bounce on a plane with normal of the Y axis should.");
|
||||||
|
|
@ -379,6 +378,8 @@ TEST_CASE("[Vector2] Plane methods") {
|
||||||
vector.slide(vector_normal).is_equal_approx(Vector2(-0.8292559899117276166456, 2.798738965952080706179)),
|
vector.slide(vector_normal).is_equal_approx(Vector2(-0.8292559899117276166456, 2.798738965952080706179)),
|
||||||
"Vector2 slide with normal should return expected value.");
|
"Vector2 slide with normal should return expected value.");
|
||||||
// There's probably a better way to test these ones?
|
// There's probably a better way to test these ones?
|
||||||
|
#ifdef MATH_CHECKS
|
||||||
|
const Vector2 vector_non_normal = Vector2(5.4, 1.6);
|
||||||
ERR_PRINT_OFF;
|
ERR_PRINT_OFF;
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
vector.bounce(vector_non_normal).is_equal_approx(Vector2()),
|
vector.bounce(vector_non_normal).is_equal_approx(Vector2()),
|
||||||
|
|
@ -390,6 +391,7 @@ TEST_CASE("[Vector2] Plane methods") {
|
||||||
vector.slide(vector_non_normal).is_equal_approx(Vector2()),
|
vector.slide(vector_non_normal).is_equal_approx(Vector2()),
|
||||||
"Vector2 slide should return empty Vector2 with non-normalized input.");
|
"Vector2 slide should return empty Vector2 with non-normalized input.");
|
||||||
ERR_PRINT_ON;
|
ERR_PRINT_ON;
|
||||||
|
#endif // MATH_CHECKS
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[Vector2] Rounding methods") {
|
TEST_CASE("[Vector2] Rounding methods") {
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,6 @@ TEST_CASE("[Vector3] Plane methods") {
|
||||||
const Vector3 vector = Vector3(1.2, 3.4, 5.6);
|
const Vector3 vector = Vector3(1.2, 3.4, 5.6);
|
||||||
const Vector3 vector_y = Vector3(0, 1, 0);
|
const Vector3 vector_y = Vector3(0, 1, 0);
|
||||||
const Vector3 vector_normal = Vector3(0.88763458893247992491, 0.26300284116517923701, 0.37806658417494515320);
|
const Vector3 vector_normal = Vector3(0.88763458893247992491, 0.26300284116517923701, 0.37806658417494515320);
|
||||||
const Vector3 vector_non_normal = Vector3(5.4, 1.6, 2.3);
|
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
vector.bounce(vector_y) == Vector3(1.2, -3.4, 5.6),
|
vector.bounce(vector_y) == Vector3(1.2, -3.4, 5.6),
|
||||||
"Vector3 bounce on a plane with normal of the Y axis should.");
|
"Vector3 bounce on a plane with normal of the Y axis should.");
|
||||||
|
|
@ -394,6 +393,8 @@ TEST_CASE("[Vector3] Plane methods") {
|
||||||
vector.slide(vector_normal).is_equal_approx(Vector3(-2.41848149148878681437, 2.32785733585517427722237, 4.0587949202918130235)),
|
vector.slide(vector_normal).is_equal_approx(Vector3(-2.41848149148878681437, 2.32785733585517427722237, 4.0587949202918130235)),
|
||||||
"Vector3 slide with normal should return expected value.");
|
"Vector3 slide with normal should return expected value.");
|
||||||
// There's probably a better way to test these ones?
|
// There's probably a better way to test these ones?
|
||||||
|
#ifdef MATH_CHECKS
|
||||||
|
const Vector3 vector_non_normal = Vector3(5.4, 1.6, 2.3);
|
||||||
ERR_PRINT_OFF;
|
ERR_PRINT_OFF;
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
vector.bounce(vector_non_normal).is_equal_approx(Vector3()),
|
vector.bounce(vector_non_normal).is_equal_approx(Vector3()),
|
||||||
|
|
@ -405,6 +406,7 @@ TEST_CASE("[Vector3] Plane methods") {
|
||||||
vector.slide(vector_non_normal).is_equal_approx(Vector3()),
|
vector.slide(vector_non_normal).is_equal_approx(Vector3()),
|
||||||
"Vector3 slide should return empty Vector3 with non-normalized input.");
|
"Vector3 slide should return empty Vector3 with non-normalized input.");
|
||||||
ERR_PRINT_ON;
|
ERR_PRINT_ON;
|
||||||
|
#endif // MATH_CHECKS
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[Vector3] Rounding methods") {
|
TEST_CASE("[Vector3] Rounding methods") {
|
||||||
|
|
|
||||||
|
|
@ -373,8 +373,10 @@ void validate_property(const Context &p_context, const ExposedClass &p_class, co
|
||||||
}
|
}
|
||||||
|
|
||||||
void validate_argument(const Context &p_context, const ExposedClass &p_class, const String &p_owner_name, const String &p_owner_type, const ArgumentData &p_arg) {
|
void validate_argument(const Context &p_context, const ExposedClass &p_class, const String &p_owner_name, const String &p_owner_type, const ArgumentData &p_arg) {
|
||||||
|
#ifdef DEBUG_METHODS_ENABLED
|
||||||
TEST_COND((p_arg.name.is_empty() || p_arg.name.begins_with("_unnamed_arg")),
|
TEST_COND((p_arg.name.is_empty() || p_arg.name.begins_with("_unnamed_arg")),
|
||||||
vformat("Unnamed argument in position %d of %s '%s.%s'.", p_arg.position, p_owner_type, p_class.name, p_owner_name));
|
vformat("Unnamed argument in position %d of %s '%s.%s'.", p_arg.position, p_owner_type, p_class.name, p_owner_name));
|
||||||
|
#endif // DEBUG_METHODS_ENABLED
|
||||||
|
|
||||||
const ExposedClass *arg_class = p_context.find_exposed_class(p_arg.type);
|
const ExposedClass *arg_class = p_context.find_exposed_class(p_arg.type);
|
||||||
if (arg_class) {
|
if (arg_class) {
|
||||||
|
|
|
||||||
|
|
@ -117,12 +117,14 @@ TEST_CASE("[OS] Processor count and memory information") {
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
OS::get_singleton()->get_processor_count() >= 1,
|
OS::get_singleton()->get_processor_count() >= 1,
|
||||||
"The returned processor count should be greater than zero.");
|
"The returned processor count should be greater than zero.");
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
OS::get_singleton()->get_static_memory_usage() >= 1,
|
OS::get_singleton()->get_static_memory_usage() >= 1,
|
||||||
"The returned static memory usage should be greater than zero.");
|
"The returned static memory usage should be greater than zero.");
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
OS::get_singleton()->get_static_memory_peak_usage() >= 1,
|
OS::get_singleton()->get_static_memory_peak_usage() >= 1,
|
||||||
"The returned static memory peak usage should be greater than zero.");
|
"The returned static memory peak usage should be greater than zero.");
|
||||||
|
#endif // DEBUG_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[OS] Execute") {
|
TEST_CASE("[OS] Execute") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue