Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance optimizations & basic CICD for the submodule #66

Merged
merged 6 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Godot
description: Build Godot with the provided options.
defaults:
run:
working-directory: ./godot-engine
inputs:
target:
description: Build target (editor, template_release, template_debug).
default: "editor"
tests:
description: Unit tests.
default: false
platform:
description: Target platform.
required: false
sconsflags:
default: ""
scons-cache:
description: The scons cache path.
default: "${{ github.workspace }}/.scons-cache/"
scons-cache-limit:
description: The scons cache size limit.
# 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.
default: 7168
runs:
using: "composite"
steps:
- name: Scons Build
shell: sh
env:
SCONSFLAGS: ${{ inputs.sconsflags }}
SCONS_CACHE: ${{ inputs.scons-cache }}
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
run: |
cd godot-engine
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}

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 }}
ls -l bin/
103 changes: 103 additions & 0 deletions .github/workflows/linux_builds_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: 🐧 Linux Builds
on:
push:
paths:
- godot-engine/**

defaults:
run:
working-directory: ./godot-engine

# Global Settings
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes fontconfig=no
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt

concurrency:
# workflow name - PR || fallback to unique run id, this happens when you're not building a PR
# this ensures all branches build properly and cancel their previous runs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-linux:
runs-on: "ubuntu-20.04" # MUST run on the old version for GLIBC compatibility
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor
cache-name: linux-editor
target: editor
sconsflags: arch=x86_64 debug_symbols=no optimize=speed production=yes
strip: false
bin: "./bin/godot.linuxbsd.editor.x86_64"
artifact-name: "MirrorGodotEditorLinux.x86_64"
artifact: true
tests: no

- name: Template
cache-name: linux-template
target: template_debug
strip: true
sconsflags: arch=x86_64 debug_symbols=no optimize=speed
bin: "./bin/godot.linuxbsd.template_debug.x86_64"
artifact-name: "linux_release.x86_64"
artifact: true
tests: no

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup scons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
scons --version

- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master

- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Strip binaries
if: ${{ matrix.strip }}
run: |
strip bin/godot.*

# - name: Shrink debug symbols
# if: ${{ !matrix.strip }}
# run: |
# # remove duplicate symbols from binary
# dwz ${{ matrix.bin }} -L none -o Middleman.debug
# # make the debug symbols compressed
# objcopy --compress-debug-sections Middleman.debug FinalMan.debug
# # overwrite the original file
# mv FinalMan.debug ${{ matrix.bin }}

- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
chmod +x bin/godot.*
mv ${{ matrix.bin }} bin/${{ matrix.artifact-name }}

133 changes: 133 additions & 0 deletions .github/workflows/macos_builds_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: 🍎 macOS Builds
on:
push:
paths:
- godot-engine/**

defaults:
run:
working-directory: ./godot-engine

# Global Settings
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes fontconfig=no use_volk=no

concurrency:
# workflow name - PR || fallback to unique run id, this happens when you're not building a PR
# this ensures all branches build properly and cancel their previous runs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-macos:
runs-on: "macos-latest"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor
cache-name: macos-editor
target: editor
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed production=yes
dist-app: "macos_tools.app"
packaged-app: "MirrorGodotEditorMac.app"
bin-name: "godot.macos.editor.universal"
bin-name-x86_64: "godot.macos.editor.x86_64"
bin-name-arm64: "godot.macos.editor.arm64"
artifact-bin-name: "Godot"
artifact-name: "MirrorGodotEditorMac.app"

- name: Template
cache-name: macos-template
target: template_debug
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed
dist-app: "macos_template.app"
packaged-app: "macos_template.app"
bin-name: "godot.macos.template_debug.universal"
bin-name-x86_64: "godot.macos.template_debug.x86_64"
bin-name-arm64: "godot.macos.template_debug.arm64"
artifact-bin-name: "godot_macos_release.universal"
artifact-name: "macos_template.app"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup python and scons
uses: ./godot-engine/.github/actions/godot-deps
- name: Setup Vulkan SDK
run: |
# Download and install the Vulkan SDK.
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg" -o /tmp/vulkan-sdk.dmg
hdiutil attach /tmp/vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \
--accept-licenses --default-answer --confirm-command install

- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup scons (python is already installed on self-hosted runners!)
shell: bash
run: |
python3 -c "import sys; print(sys.version)"
python3 -m ensurepip --upgrade
python3 -m pip install --user scons
scons --version

- name: Setup cmake
shell: bash
run: |
brew install cmake
cmake --version

- name: Remove existing binaries
run: |
rm -Rf bin/

- name: Compilation (x86_64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Strip binaries
if: ${{ matrix.strip }}
run: |
echo "Stripping binaries"
strip bin/*

- name: Prepare universal executable
run: |
lipo -create bin/${{ matrix.bin-name-x86_64 }} bin/${{ matrix.bin-name-arm64 }} -output bin/${{ matrix.bin-name }}
chmod -R +x bin/*

- name: Package in macOS app bundle
shell: sh
run: |
cp -R misc/dist/${{ matrix.dist-app }} bin/${{ matrix.packaged-app }}
cd bin/
mkdir -p ${{ matrix.packaged-app }}/Contents/MacOS
cp ${{ matrix.bin-name }} ${{ matrix.packaged-app }}/Contents/MacOS/${{ matrix.artifact-bin-name }}
chmod -R +x ${{ matrix.packaged-app }}
xattr -rc ${{ matrix.packaged-app }}
zip -q -9 -r ${{ matrix.artifact-name }}.zip ${{ matrix.packaged-app }}
97 changes: 97 additions & 0 deletions .github/workflows/windows_builds_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: 🏁 Windows Builds
on:
push:
paths:
- godot-engine/**

defaults:
run:
working-directory: ./godot-engine

# Global Settings
# SCONS_CACHE for windows must be set in the build environment
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes fontconfig=no
SCONS_CACHE_MSVC_CONFIG: true

concurrency:
# workflow name - PR || fallback to unique run id, this happens when you're not building a PR
# this ensures all branches build properly and cancel their previous runs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-windows:
runs-on: "windows-latest"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor
cache-name: windows-editor
target: editor
strip: true
tests: false
sconsflags: arch=x86_64 debug_symbols=no windows_subsystem=console optimize=speed production=yes
bin: "./bin/godot.windows.editor.x86_64"
artifact-name: "MirrorGodotEditorWindows"
artifact: true

- name: Template
cache-name: windows-template
target: template_debug
strip: true
tests: false
sconsflags: arch=x86_64 debug_symbols=no optimize=speed
bin: "./bin/godot.windows.template_debug.x86_64"
artifact-name: "windows_release_x86_64"
artifact: true

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup python and scons
uses: ./godot-engine/.github/actions/godot-deps

#- name: Download Direct3D 12 SDK components
# run: python ./misc/scripts/install_d3d12_sdk_windows.py

- name: Setup MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master

- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: windows
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Strip binaries
if: ${{ matrix.strip }}
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force

- name: Move PDB file (if not stripped)
if: ${{ !matrix.strip }}
run: |
dir -Path ./bin/
mv ${{matrix.bin}}.pdb bin/${{ matrix.artifact-name}}.pdb

- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
mv ${{ matrix.bin }}.exe bin/${{ matrix.artifact-name }}.exe


1 change: 0 additions & 1 deletion mirror-godot-app/gameplay/space_object/space_object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,6 @@ func _interaction_set_transform(new_transform: Transform3D):
global_transform = new_transform
interpolated_node.update_space_object_transform(0.0, global_transform)


func get_creator() -> Dictionary:
var creator_user_id: String = ""
if space_object_data.has("creator"):
Expand Down
Loading
Loading