| 1 |
name: 🐧 Linux Builds |
| 2 |
on: |
| 3 |
workflow_call: |
| 4 |
workflow_dispatch: |
| 5 |
|
| 6 |
|
| 7 |
env: |
| 8 |
SCONS_FLAGS: >- |
| 9 |
dev_mode=yes |
| 10 |
module_text_server_fb_enabled=yes |
| 11 |
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.21.2/" |
| 12 |
GODOT_CPP_BRANCH: 4.5 |
| 13 |
DOTNET_NOLOGO: true |
| 14 |
DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 15 |
ASAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/asan.txt |
| 16 |
LSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/lsan.txt |
| 17 |
TSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/tsan.txt |
| 18 |
UBSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/ubsan.txt |
| 19 |
|
| 20 |
jobs: |
| 21 |
build-linux: |
| 22 |
|
| 23 |
runs-on: ubuntu-22.04 |
| 24 |
name: ${{ matrix.name }} |
| 25 |
timeout-minutes: 120 |
| 26 |
strategy: |
| 27 |
fail-fast: false |
| 28 |
matrix: |
| 29 |
include: |
| 30 |
- name: Editor w/ Mono (target=editor) |
| 31 |
cache-name: linux-editor-mono |
| 32 |
target: editor |
| 33 |
scons-flags: module_mono_enabled=yes |
| 34 |
bin: ./bin/godot.linuxbsd.editor.x86_64.mono |
| 35 |
build-mono: true |
| 36 |
doc-test: true |
| 37 |
proj-conv: true |
| 38 |
api-compat: true |
| 39 |
artifact: true |
| 40 |
|
| 41 |
godot-cpp: true |
| 42 |
|
| 43 |
- name: Editor with doubles and GCC sanitizers (target=editor, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=mold) |
| 44 |
cache-name: linux-editor-double-sanitizers |
| 45 |
target: editor |
| 46 |
|
| 47 |
scons-flags: >- |
| 48 |
dev_build=yes |
| 49 |
scu_build=yes |
| 50 |
debug_symbols=no |
| 51 |
precision=double |
| 52 |
use_asan=yes |
| 53 |
use_ubsan=yes |
| 54 |
linker=mold |
| 55 |
bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san |
| 56 |
proj-test: true |
| 57 |
|
| 58 |
- name: Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld) |
| 59 |
cache-name: linux-editor-llvm-sanitizers |
| 60 |
target: editor |
| 61 |
scons-flags: >- |
| 62 |
dev_build=yes |
| 63 |
use_asan=yes |
| 64 |
use_ubsan=yes |
| 65 |
use_llvm=yes |
| 66 |
linker=lld |
| 67 |
bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san |
| 68 |
|
| 69 |
legacy-scons: true |
| 70 |
|
| 71 |
- name: Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld) |
| 72 |
cache-name: linux-editor-thread-sanitizer |
| 73 |
target: editor |
| 74 |
scons-flags: >- |
| 75 |
dev_build=yes |
| 76 |
use_tsan=yes |
| 77 |
use_llvm=yes |
| 78 |
linker=lld |
| 79 |
bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san |
| 80 |
|
| 81 |
- name: Template w/ Mono, release (target=template_release) |
| 82 |
cache-name: linux-template-mono |
| 83 |
target: template_release |
| 84 |
scons-flags: module_mono_enabled=yes |
| 85 |
bin: ./bin/godot.linuxbsd.template_release.x86_64.mono |
| 86 |
artifact: true |
| 87 |
|
| 88 |
- name: Template w/ Mono, debug (target=template_debug) |
| 89 |
cache-name: linux-template-mono-debug |
| 90 |
target: template_debug |
| 91 |
scons-flags: module_mono_enabled=yes |
| 92 |
bin: ./bin/godot.linuxbsd.template_debug.x86_64.mono |
| 93 |
artifact: true |
| 94 |
|
| 95 |
- name: Minimal template (target=template_release, everything disabled) |
| 96 |
cache-name: linux-template-minimal |
| 97 |
target: template_release |
| 98 |
scons-flags: >- |
| 99 |
modules_enabled_by_default=no |
| 100 |
module_text_server_fb_enabled=no |
| 101 |
disable_3d=yes |
| 102 |
disable_advanced_gui=yes |
| 103 |
disable_physics_2d=yes |
| 104 |
disable_physics_3d=yes |
| 105 |
deprecated=no |
| 106 |
minizip=no |
| 107 |
brotli=no |
| 108 |
bin: ./bin/godot.linuxbsd.template_release.x86_64 |
| 109 |
artifact: true |
| 110 |
|
| 111 |
steps: |
| 112 |
- name: Checkout |
| 113 |
uses: actions/checkout@v6 |
| 114 |
with: |
| 115 |
submodules: recursive |
| 116 |
|
| 117 |
- name: Setup dependencies |
| 118 |
run: | |
| 119 |
sudo apt-get update |
| 120 |
sudo apt-get install libwayland-bin # TODO: Figure out somehow how to embed this one. |
| 121 |
if [ "${{ matrix.proj-test }}" == "true" ]; then |
| 122 |
sudo apt-get install mesa-vulkan-drivers |
| 123 |
fi |
| 124 |
|
| 125 |
- name: Free disk space on runner |
| 126 |
run: | |
| 127 |
echo "Disk usage before:" && df -h |
| 128 |
sudo rm -rf /usr/local/lib/android |
| 129 |
echo "Disk usage after:" && df -h |
| 130 |
|
| 131 |
- name: Restore Godot build cache |
| 132 |
uses: ./.github/actions/godot-cache-restore |
| 133 |
with: |
| 134 |
cache-name: ${{ matrix.cache-name }} |
| 135 |
continue-on-error: true |
| 136 |
|
| 137 |
- name: Setup Python and SCons |
| 138 |
if: "!matrix.legacy-scons" |
| 139 |
uses: ./.github/actions/godot-deps |
| 140 |
|
| 141 |
- name: Setup Python and SCons (legacy versions) |
| 142 |
if: matrix.legacy-scons |
| 143 |
uses: ./.github/actions/godot-deps |
| 144 |
with: |
| 145 |
|
| 146 |
python-version: 3.8 |
| 147 |
scons-version: 4.0 |
| 148 |
|
| 149 |
- name: Force remove preinstalled .NET SDKs |
| 150 |
if: matrix.build-mono |
| 151 |
run: | |
| 152 |
sudo rm -rf /usr/share/dotnet/sdk/* |
| 153 |
|
| 154 |
- name: Setup older .NET SDK as baseline |
| 155 |
if: matrix.build-mono |
| 156 |
uses: actions/setup-dotnet@v5 |
| 157 |
with: |
| 158 |
|
| 159 |
dotnet-version: 8.0.100 |
| 160 |
|
| 161 |
- name: Download pre-built AccessKit |
| 162 |
uses: dsaltares/[email protected] |
| 163 |
with: |
| 164 |
repo: godotengine/godot-accesskit-c-static |
| 165 |
version: tags/0.21.2 |
| 166 |
file: accesskit-c-0.21.2.zip |
| 167 |
target: accesskit-c-0.21.2/accesskit_c.zip |
| 168 |
|
| 169 |
- name: Extract pre-built AccessKit |
| 170 |
run: unzip -o accesskit-c-0.21.2/accesskit_c.zip |
| 171 |
|
| 172 |
- name: Install mold linker |
| 173 |
if: matrix.proj-test |
| 174 |
uses: rui314/setup-mold@v1 |
| 175 |
|
| 176 |
- name: Compilation |
| 177 |
uses: ./.github/actions/godot-build |
| 178 |
with: |
| 179 |
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} |
| 180 |
platform: linuxbsd |
| 181 |
target: ${{ matrix.target }} |
| 182 |
|
| 183 |
- name: Compilation (godot-cpp) |
| 184 |
uses: ./.github/actions/godot-cpp-build |
| 185 |
if: matrix.godot-cpp |
| 186 |
with: |
| 187 |
bin: ${{ matrix.bin }} |
| 188 |
scons-flags: target=template_debug dev_build=yes verbose=yes |
| 189 |
godot-cpp-branch: ${{ env.GODOT_CPP_BRANCH }} |
| 190 |
|
| 191 |
- name: Save Godot build cache |
| 192 |
uses: ./.github/actions/godot-cache-save |
| 193 |
with: |
| 194 |
cache-name: ${{ matrix.cache-name }} |
| 195 |
continue-on-error: true |
| 196 |
|
| 197 |
- name: Generate C# glue |
| 198 |
if: matrix.build-mono |
| 199 |
run: | |
| 200 |
${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue |
| 201 |
|
| 202 |
- name: Build .NET solutions |
| 203 |
if: matrix.build-mono |
| 204 |
run: | |
| 205 |
dotnet --info |
| 206 |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd --werror |
| 207 |
|
| 208 |
- name: Prepare artifact |
| 209 |
if: matrix.artifact |
| 210 |
run: | |
| 211 |
strip bin/godot.* |
| 212 |
chmod +x bin/godot.* |
| 213 |
|
| 214 |
- name: Upload artifact |
| 215 |
uses: ./.github/actions/upload-artifact |
| 216 |
if: matrix.artifact |
| 217 |
with: |
| 218 |
name: ${{ matrix.cache-name }} |
| 219 |
|
| 220 |
- name: Unit tests |
| 221 |
run: | |
| 222 |
${{ matrix.bin }} --version |
| 223 |
${{ matrix.bin }} --help |
| 224 |
${{ matrix.bin }} --headless --test --force-colors |
| 225 |
|
| 226 |
- name: .NET source generators tests |
| 227 |
if: matrix.build-mono |
| 228 |
run: | |
| 229 |
dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests |
| 230 |
|
| 231 |
|
| 232 |
- name: Check for class reference updates |
| 233 |
if: matrix.doc-test |
| 234 |
run: | |
| 235 |
echo "Running --doctool to see if this changes the public API without updating the documentation." |
| 236 |
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n" |
| 237 |
${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true |
| 238 |
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$' |
| 239 |
|
| 240 |
|
| 241 |
- name: Check for GDExtension compatibility |
| 242 |
if: matrix.api-compat |
| 243 |
run: | |
| 244 |
./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}" |
| 245 |
|
| 246 |
|
| 247 |
- name: Test Godot project |
| 248 |
uses: ./.github/actions/godot-project-test |
| 249 |
if: matrix.proj-test |
| 250 |
with: |
| 251 |
bin: ${{ matrix.bin }} |
| 252 |
|
| 253 |
|
| 254 |
- name: Test project converter |
| 255 |
uses: ./.github/actions/godot-converter-test |
| 256 |
if: matrix.proj-conv |
| 257 |
with: |
| 258 |
bin: ${{ matrix.bin }} |