Skip to content

Commit

Permalink
CI: Format SCons input flags & build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Repiteo committed Jan 18, 2025
1 parent 7b1ed52 commit a353006
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 79 deletions.
17 changes: 8 additions & 9 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ inputs:
target:
description: Build target (editor, template_release, template_debug).
default: editor
tests:
description: Unit tests.
default: false
required: false
type: choice
options: [editor, template_debug, template_release]
platform:
description: Target platform.
required: false
type: string
sconsflags:
description: Additional SCons flags.
default: ""
required: false
type: string
scons-cache:
description: The SCons cache path.
default: ${{ github.workspace }}/.scons_cache/
type: string
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: 7
type: number

runs:
using: composite
Expand All @@ -33,7 +32,7 @@ runs:
env:
SCONSFLAGS: ${{ inputs.sconsflags }}
run: |
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
if [ "${{ inputs.target }}" != "editor" ]; then
# Ensure we don't include editor code in export template builds.
Expand All @@ -47,5 +46,5 @@ runs:
export BUILD_NAME="gh"
fi
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
scons platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
ls -l bin/
23 changes: 11 additions & 12 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
SCONSFLAGS: >-
dev_mode=yes
module_text_server_fb_enabled=yes
tests=no
swappy=yes
jobs:
build-android:
Expand All @@ -20,23 +24,19 @@ jobs:
- name: Editor (target=editor)
cache-name: android-editor
target: editor
tests: false
sconsflags: arch=arm64 production=yes swappy=yes
cache-limit: 1
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 swappy=yes
cache-limit: 1
sconsflags: arch=arm32

- name: Template arm64 (target=template_release, arch=arm64)
cache-name: android-template-arm64
target: template_release
tests: false
sconsflags: arch=arm64 swappy=yes
cache-limit: 1
sconsflags: arch=arm64

steps:
- name: Checkout
Expand Down Expand Up @@ -76,8 +76,7 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: android
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
scons-cache-limit: ${{ matrix.cache-limit }}
scons-cache-limit: 1

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
SCONSFLAGS: >-
dev_mode=yes
module_text_server_fb_enabled=yes
tests=no
debug_symbols=no
jobs:
ios-template:
Expand All @@ -33,7 +37,6 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }}
platform: ios
target: template_release
tests: false
scons-cache-limit: 1

- name: Save Godot build cache
Expand Down
63 changes: 35 additions & 28 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
SCONSFLAGS: >-
dev_mode=yes
module_text_server_fb_enabled=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt
Expand All @@ -28,68 +30,75 @@ jobs:
sconsflags: module_mono_enabled=yes
bin: ./bin/godot.linuxbsd.editor.x86_64.mono
build-mono: true
tests: false # Disabled due freeze caused by mix Mono build and CI
doc-test: true
proj-conv: true
api-compat: true
artifact: true
cache-limit: 1

- 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)
- name: Editor with doubles and GCC sanitizers (target=editor, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
cache-name: linux-editor-double-sanitizers
target: editor
# Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
sconsflags: dev_build=yes scu_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
build-mono: false
tests: true
proj-test: true
# Generate an API dump for godot-cpp tests.
api-dump: true
# Skip 2GiB artifact speeding up action.
artifact: false
cache-limit: 7

- name: Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)
- name: Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)
cache-name: linux-editor-llvm-sanitizers
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
build-mono: false
tests: true
# Skip 2GiB artifact speeding up action.
artifact: false
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
legacy-scons: true
cache-limit: 7

- name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
- name: Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
cache-name: linux-editor-thread-sanitizer
target: editor
tests: true
sconsflags: dev_build=yes use_tsan=yes use_llvm=yes linker=lld
sconsflags: >-
dev_build=yes
use_tsan=yes
use_llvm=yes
linker=lld
bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
build-mono: false
# Skip 2GiB artifact speeding up action.
artifact: false
cache-limit: 5

- name: Template w/ Mono (target=template_release, tests=yes)
- name: Template w/ Mono (target=template_release)
cache-name: linux-template-mono
target: template_release
sconsflags: module_mono_enabled=yes
bin: ./bin/godot.linuxbsd.template_release.x86_64.mono
build-mono: false
tests: true
artifact: true
cache-limit: 1

- name: Minimal template (target=template_release, tests=yes, everything disabled)
- name: Minimal template (target=template_release, everything disabled)
cache-name: linux-template-minimal
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
module_text_server_fb_enabled=no
disable_3d=yes
disable_advanced_gui=yes
deprecated=no
minizip=no
brotli=no
bin: ./bin/godot.linuxbsd.template_release.x86_64
tests: true
artifact: true
cache-limit: 1

Expand Down Expand Up @@ -155,7 +164,6 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Save Godot build cache
Expand Down Expand Up @@ -194,7 +202,6 @@ jobs:
bin: ${{ matrix.bin }}

- name: Unit tests
if: matrix.tests
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
SCONSFLAGS: >-
dev_mode=yes
module_text_server_fb_enabled=yes
jobs:
build-macos:
Expand All @@ -17,17 +19,15 @@ jobs:
fail-fast: false
matrix:
include:
- name: Editor (target=editor, tests=yes)
- name: Editor (target=editor)
cache-name: macos-editor
target: editor
tests: true
bin: ./bin/godot.macos.editor.universal
cache-limit: 1

- name: Template (target=template_release, tests=yes)
- name: Template (target=template_release)
cache-name: macos-template
target: template_release
tests: true
sconsflags: debug_symbols=no
bin: ./bin/godot.macos.template_release.universal
cache-limit: 1
Expand Down Expand Up @@ -57,7 +57,6 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
scons-cache-limit: 0 # Only cap on second run to avoid purging unnecessarily

- name: Compilation (arm64)
Expand All @@ -66,7 +65,6 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Save Godot build cache
Expand All @@ -88,7 +86,6 @@ jobs:
name: ${{ matrix.cache-name }}

- name: Unit tests
if: matrix.tests
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
SCONSFLAGS: >-
dev_mode=yes
tests=no
debug_symbols=no
use_closure_compiler=yes
EM_VERSION: 3.1.64

jobs:
Expand All @@ -22,14 +26,12 @@ jobs:
cache-name: web-template
target: template_release
sconsflags: threads=yes
tests: false
artifact: true

- name: Template w/o threads (target=template_release, threads=no)
cache-name: web-nothreads-template
target: template_release
sconsflags: threads=no
tests: false
artifact: true

steps:
Expand Down Expand Up @@ -63,7 +65,6 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: web
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
scons-cache-limit: 0.5

- name: Save Godot build cache
Expand Down
Loading

0 comments on commit a353006

Please sign in to comment.