Skip to content
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
38 changes: 38 additions & 0 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Godot
description: Build Godot with the provided options.
inputs:
target:
description: The scons target (debug/release_debug/release).
default: "debug"
tools:
description: If tools are to be built.
default: false
tests:
description: If tests are to be built.
default: false
platform:
description: The Godot platform to build.
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: |
echo "Building with flags:" ${{ env.SCONSFLAGS }}
scons p=${{ inputs.platform }} target=${{ inputs.target }} tools=${{ inputs.tools }} tests=${{ inputs.tests }} --jobs=2 ${{ env.SCONSFLAGS }}
ls -l bin/
21 changes: 21 additions & 0 deletions .github/actions/godot-cache-restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Restore Godot build cache
description: Restore 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: Restore .scons_cache directory
uses: actions/cache/restore@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}
17 changes: 17 additions & 0 deletions .github/actions/godot-cache-save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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}}
27 changes: 27 additions & 0 deletions .github/actions/godot-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup python and scons
description: Setup python, install the pip version of scons.
inputs:
python-version:
description: The python version to use.
default: "3.x"
python-arch:
description: The python architecture.
default: "x64"
runs:
using: "composite"
steps:
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: ${{ inputs.python-version }}
# Optional - x64 or x86 architecture, defaults to x64
architecture: ${{ inputs.python-arch }}

- name: Setup scons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.7.0
scons --version
19 changes: 19 additions & 0 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Upload Godot artifact
description: Upload the Godot artifact.
inputs:
name:
description: The artifact name.
default: "${{ github.job }}"
path:
description: The path to upload.
required: true
default: "bin/*"
runs:
using: "composite"
steps:
- name: Upload Godot Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
retention-days: 14
78 changes: 33 additions & 45 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,64 @@
name: 🤖 Android Builds
on: [push, pull_request]
on:
workflow_call:

# Global Settings
env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: 3.3
SCONSFLAGS: platform=android verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android
cancel-in-progress: true

jobs:
android-template:
runs-on: "ubuntu-20.04"

name: Template (target=release, tools=no)

steps:
- uses: actions/checkout@v4

# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update

- name: Set up Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

# Upload cache on completion and check it out now
- name: Load .scons_cache directory
id: android-template-cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v5
- name: Setup python and scons
uses: ./.github/actions/godot-deps

- name: Compilation (armv7)
uses: ./.github/actions/godot-build
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
sconsflags: ${{ env.SCONSFLAGS }} android_arch=armv7
platform: android
target: release
tools: false

- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation (arm64v8)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} android_arch=arm64v8
platform: android
target: release
tools: false

- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true

- name: Generate Godot templates
run: |
scons target=release tools=no android_arch=armv7
scons target=release tools=no android_arch=arm64v8
cd platform/android/java
./gradlew generateGodotTemplates
cd ../../..
ls -l bin/

- uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}
path: bin/*
retention-days: 14
- name: Upload artifact
uses: ./.github/actions/upload-artifact
68 changes: 26 additions & 42 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: 🍏 iOS Builds
on: [push, pull_request]
on:
workflow_call:

# Global Settings
env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: 3.3
SCONSFLAGS: platform=iphone verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ios
cancel-in-progress: true

jobs:
ios-template:
Expand All @@ -15,45 +20,24 @@ jobs:
steps:
- uses: actions/checkout@v4

# Upload cache on completion and check it out now
- name: Load .scons_cache directory
id: ios-template-cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'

# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version

- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons target=release tools=no
ls -l bin/

- uses: actions/upload-artifact@v4
- name: Setup python and scons
uses: ./.github/actions/godot-deps

- name: Compilation (arm64v8)
uses: ./.github/actions/godot-build
with:
name: ${{ github.job }}
path: bin/*
retention-days: 14
sconsflags: ${{ env.SCONSFLAGS }}
platform: iphone
target: release
tools: false

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
Loading
Loading