Skip to content

Commit

Permalink
CI: Fully sync workflows and actions with 3.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Nov 7, 2024
1 parent 01621dd commit d334389
Show file tree
Hide file tree
Showing 33 changed files with 375 additions and 132 deletions.
4 changes: 3 additions & 1 deletion .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ inputs:
default: "${{ github.workspace }}/.scons-cache/"
scons-cache-limit:
description: The scons cache size limit.
default: 4096
# 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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Godot build cache
description: Setup Godot build cache.
name: Restore Godot build cache
description: Restore Godot build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
Expand All @@ -10,9 +10,8 @@ inputs:
runs:
using: "composite"
steps:
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v4
- 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}}
Expand Down
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}}
2 changes: 1 addition & 1 deletion .github/actions/godot-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ runs:
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python -m pip install scons==4.7.0
scons --version
22 changes: 10 additions & 12 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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.4
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no

Expand All @@ -12,28 +14,20 @@ concurrency:

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

runs-on: "ubuntu-24.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

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -55,6 +49,10 @@ jobs:
target: release
tools: false

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

- name: Generate Godot templates
run: |
cd platform/android/java
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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.4
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no

Expand All @@ -18,20 +20,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

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

- name: Compilation (armv7)
- name: Compilation (arm64v8)
uses: ./.github/actions/godot-build
with:
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
23 changes: 11 additions & 12 deletions .github/workflows/javascript_builds.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: 🌐 JavaScript 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.4
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no
EM_VERSION: 2.0.25
Expand All @@ -14,32 +16,25 @@ concurrency:

jobs:
javascript-template:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
name: Template (target=release, tools=no)

steps:
- uses: actions/checkout@v4

# Additional cache for Emscripten generated system libraries
- name: Load Emscripten cache
id: javascript-template-emscripten-cache
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{github.job}}

- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
cache-key: emsdk-${{ matrix.cache-name }}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}

- name: Verify Emscripten setup
run: |
emcc -v
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -53,5 +48,9 @@ jobs:
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
44 changes: 31 additions & 13 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: 🐧 Linux 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.4
SCONSFLAGS: verbose=yes warnings=all werror=yes

Expand All @@ -12,7 +14,8 @@ concurrency:

jobs:
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 }}
strategy:
fail-fast: false
Expand All @@ -27,11 +30,11 @@ jobs:
build-mono: true
artifact: true

- name: Editor and sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes)
- name: Editor and sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes, linker=gold)
cache-name: linux-editor-sanitizers
target: debug
tools: true
sconsflags: use_asan=yes use_ubsan=yes
sconsflags: use_asan=yes use_ubsan=yes linker=gold
test: true
bin: "./bin/godot.x11.tools.64s"
build-mono: false
Expand All @@ -52,24 +55,32 @@ jobs:
- name: Linux dependencies
shell: bash
run: |
# Azure repositories are not reliable, we need to prevent azure giving us packages.
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
# Azure repositories are flaky, remove them.
sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
sudo apt-get update
# The actual dependencies
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
# The actual dependencies.
sudo apt-get install --no-install-recommends build-essential pkg-config libx11-dev \
libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \
libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Free disk space on runner
run: |
echo "Disk usage before:" && df -h
sudo rm -rf /usr/local/lib/android
echo "Disk usage after:" && df -h
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

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

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

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand All @@ -78,6 +89,12 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

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

# Generate mono glue
- name: Generate Mono glue code
if: ${{ matrix.build-mono }}
Expand Down Expand Up @@ -129,6 +146,7 @@ jobs:
if: ${{ matrix.artifact }}
run: |
strip bin/godot.*
chmod +x bin/godot.*
- name: Upload artifact
uses: ./.github/actions/upload-artifact
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: 🍎 macOS 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.4
SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no

Expand Down Expand Up @@ -32,8 +34,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -49,6 +51,17 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

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

- name: Prepare artifact
run: |
strip bin/godot.*
chmod +x bin/godot.*
- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 🔗 GHA
on: [push, pull_request]

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

jobs:
static-checks:
name: 📊 Static
uses: ./.github/workflows/static_checks.yml

android-build:
name: 🤖 Android
needs: static-checks
uses: ./.github/workflows/android_builds.yml

ios-build:
name: 🍏 iOS
needs: static-checks
uses: ./.github/workflows/ios_builds.yml

javascript-build:
name: 🌐 JavaScript
needs: static-checks
uses: ./.github/workflows/javascript_builds.yml

linux-build:
name: 🐧 Linux
needs: static-checks
uses: ./.github/workflows/linux_builds.yml

macos-build:
name: 🍎 macOS
needs: static-checks
uses: ./.github/workflows/macos_builds.yml

server-build:
name: ☁ Server
needs: static-checks
uses: ./.github/workflows/server_builds.yml

windows-build:
name: 🏁 Windows
needs: static-checks
uses: ./.github/workflows/windows_builds.yml
Loading

0 comments on commit d334389

Please sign in to comment.