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

[Archive] physics shape de-duplication code archive #60

Draft
wants to merge 22 commits into
base: dev
Choose a base branch
from
Draft
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/
22 changes: 22 additions & 0 deletions .github/workflows/install_vulkan_sdk_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh

set -euo pipefail
IFS=$'\n\t'

# 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

cnt=5
until hdiutil detach -force /Volumes/vulkan-sdk
do
[[ cnt -eq "0" ]] && break
sleep 1
((cnt--))
done

rm -f /tmp/vulkan-sdk.dmg

echo 'Vulkan SDK installed successfully! You can now build Godot by running "scons".'
104 changes: 104 additions & 0 deletions .github/workflows/linux_builds_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: 🐧 Linux Builds
on: push
# 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 }}

134 changes: 134 additions & 0 deletions .github/workflows/macos_builds_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: 🍎 macOS Builds
on: push
# 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 }}
Loading
Loading