2020-08-22 23:04:57 +02:00
|
|
|
name: 🐧 Linux Builds
|
2023-04-04 15:56:53 +02:00
|
|
|
on:
|
|
|
|
workflow_call:
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2020-10-22 13:27:03 +02:00
|
|
|
# Global Settings
|
2020-07-24 10:19:19 +02:00
|
|
|
env:
|
2022-08-25 14:11:54 +02:00
|
|
|
# Only used for the cache key. Increment version to force clean build.
|
2021-04-19 14:37:47 +02:00
|
|
|
GODOT_BASE_BRANCH: 3.x
|
2021-09-21 21:54:55 +02:00
|
|
|
SCONSFLAGS: verbose=yes warnings=all werror=yes
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
concurrency:
|
|
|
|
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux
|
|
|
|
cancel-in-progress: true
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
jobs:
|
|
|
|
build-linux:
|
2020-07-24 10:19:19 +02:00
|
|
|
runs-on: "ubuntu-20.04"
|
2021-09-01 17:26:01 +02:00
|
|
|
name: ${{ matrix.name }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: Editor w/ Mono (target=release_debug, tools=yes)
|
|
|
|
cache-name: linux-editor-mono
|
|
|
|
target: release_debug
|
|
|
|
tools: true
|
2022-02-22 13:10:12 +01:00
|
|
|
sconsflags: module_mono_enabled=yes mono_static=yes mono_glue=no
|
2021-09-01 17:26:01 +02:00
|
|
|
bin: "./bin/godot.x11.opt.tools.64.mono"
|
|
|
|
build-mono: true
|
|
|
|
artifact: true
|
|
|
|
|
2022-07-21 11:35:38 +02:00
|
|
|
- name: Editor and sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes, linker=gold)
|
2021-09-01 17:26:01 +02:00
|
|
|
cache-name: linux-editor-sanitizers
|
|
|
|
target: debug
|
|
|
|
tools: true
|
2022-07-21 11:35:38 +02:00
|
|
|
sconsflags: use_asan=yes use_ubsan=yes linker=gold
|
2021-09-01 17:26:01 +02:00
|
|
|
test: true
|
|
|
|
bin: "./bin/godot.x11.tools.64s"
|
|
|
|
build-mono: false
|
|
|
|
# Skip 2GiB artifact speeding up action.
|
|
|
|
artifact: false
|
|
|
|
|
|
|
|
- name: Template w/ Mono (target=release, tools=no)
|
|
|
|
cache-name: linux-template-mono
|
|
|
|
target: release
|
|
|
|
tools: false
|
2022-02-22 13:10:12 +01:00
|
|
|
sconsflags: module_mono_enabled=yes mono_static=yes mono_glue=no debug_symbols=no
|
2021-09-01 17:26:01 +02:00
|
|
|
build-mono: false
|
|
|
|
artifact: true
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2024-01-06 01:48:06 +01:00
|
|
|
- name: Minimal template (target=release, tools=no, everything disabled)
|
|
|
|
cache-name: linux-template-minimal
|
|
|
|
target: release
|
|
|
|
tools: false
|
|
|
|
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no debug_symbols=no
|
|
|
|
build-mono: false
|
|
|
|
artifact: false
|
|
|
|
|
2020-07-24 10:19:19 +02:00
|
|
|
steps:
|
2023-09-04 16:05:38 +02:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
- name: Linux dependencies
|
|
|
|
shell: bash
|
2020-07-24 10:19:19 +02:00
|
|
|
run: |
|
2021-09-01 17:26:01 +02:00
|
|
|
# Azure repositories are not reliable, we need to prevent azure giving us packages.
|
2020-10-22 13:27:03 +02:00
|
|
|
sudo rm -f /etc/apt/sources.list.d/*
|
2020-07-24 10:19:19 +02:00
|
|
|
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
|
|
|
|
sudo apt-get update
|
2021-09-01 17:26:01 +02:00
|
|
|
# The actual dependencies
|
2020-07-24 10:19:19 +02:00
|
|
|
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
|
2021-09-01 17:26:01 +02:00
|
|
|
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
|
2022-05-23 14:02:12 +02:00
|
|
|
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \
|
|
|
|
libspeechd-dev speech-dispatcher
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2023-08-01 14:28:56 +02:00
|
|
|
- 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
|
|
|
|
|
2024-07-13 17:43:37 +02:00
|
|
|
- name: Restore Godot build cache
|
|
|
|
uses: ./.github/actions/godot-cache-restore
|
2020-07-24 10:19:19 +02:00
|
|
|
with:
|
2021-09-01 17:26:01 +02:00
|
|
|
cache-name: ${{ matrix.cache-name }}
|
2021-08-18 21:00:56 +02:00
|
|
|
continue-on-error: true
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
- name: Setup python and scons
|
|
|
|
uses: ./.github/actions/godot-deps
|
2020-07-24 10:19:19 +02:00
|
|
|
|
2022-10-31 16:21:33 +01:00
|
|
|
- name: Setup GCC problem matcher
|
|
|
|
uses: ammaraskar/gcc-problem-matcher@master
|
|
|
|
|
2020-07-24 10:19:19 +02:00
|
|
|
- name: Compilation
|
2021-09-01 17:26:01 +02:00
|
|
|
uses: ./.github/actions/godot-build
|
2020-10-22 13:27:03 +02:00
|
|
|
with:
|
2021-09-01 17:26:01 +02:00
|
|
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
|
|
|
|
platform: linuxbsd
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
tools: ${{ matrix.tools }}
|
|
|
|
|
2024-07-13 17:43:37 +02:00
|
|
|
- name: Save Godot build cache
|
|
|
|
uses: ./.github/actions/godot-cache-save
|
|
|
|
with:
|
|
|
|
cache-name: ${{ matrix.cache-name }}
|
|
|
|
continue-on-error: true
|
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
# Generate mono glue
|
|
|
|
- name: Generate Mono glue code
|
|
|
|
if: ${{ matrix.build-mono }}
|
2020-08-14 12:15:58 +02:00
|
|
|
run: |
|
2021-09-01 17:26:01 +02:00
|
|
|
DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --generate-mono-glue modules/mono/glue || true
|
2020-08-14 12:15:58 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
# Rebuild with mono
|
|
|
|
- name: Compilation (mono_glue=yes)
|
|
|
|
uses: ./.github/actions/godot-build
|
|
|
|
if: ${{ matrix.build-mono }}
|
2020-08-14 12:15:58 +02:00
|
|
|
with:
|
2021-09-01 17:26:01 +02:00
|
|
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} mono_glue=yes
|
|
|
|
platform: linuxbsd
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
tools: ${{ matrix.tools }}
|
|
|
|
|
|
|
|
# Download and extract zip archive with project, folder is renamed to be able to easy change used project
|
|
|
|
- name: Download test project
|
|
|
|
if: ${{ matrix.test }}
|
2020-08-14 12:15:58 +02:00
|
|
|
run: |
|
2022-01-06 12:01:00 +01:00
|
|
|
wget https://github.com/godotengine/regression-test-project/archive/3.x.zip
|
2021-03-22 18:26:18 +01:00
|
|
|
unzip 3.x.zip
|
2022-01-06 12:01:00 +01:00
|
|
|
mv "regression-test-project-3.x" "test_project"
|
2020-10-30 07:49:57 +01:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
# Editor is quite complicated piece of software, so it is easy to introduce bug here
|
|
|
|
- name: Open and close editor
|
|
|
|
if: ${{ matrix.test }}
|
|
|
|
run: |
|
|
|
|
DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy -e -q --path test_project 2>&1 | tee sanitizers_log.txt || true
|
2020-10-30 07:49:57 +01:00
|
|
|
misc/scripts/check_ci_log.py sanitizers_log.txt
|
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
# Run test project
|
|
|
|
- name: Run project
|
|
|
|
if: ${{ matrix.test }}
|
|
|
|
run: |
|
|
|
|
DRI_PRIME=0 xvfb-run ${{ matrix.bin }} 30 --video-driver GLES3 --audio-driver Dummy --path test_project 2>&1 | tee sanitizers_log.txt || true
|
2020-08-14 12:15:58 +02:00
|
|
|
misc/scripts/check_ci_log.py sanitizers_log.txt
|
2021-05-03 21:41:42 +02:00
|
|
|
|
|
|
|
# Check class reference
|
|
|
|
- name: Check for class reference updates
|
2021-09-01 17:26:01 +02:00
|
|
|
if: ${{ matrix.test }}
|
2021-05-03 21:41:42 +02:00
|
|
|
run: |
|
|
|
|
echo "Running --doctool to see if this changes the public API without updating the documentation."
|
|
|
|
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"
|
2021-09-01 17:26:01 +02:00
|
|
|
DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --doctool . 2>&1 > /dev/null || true
|
|
|
|
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
|
|
|
|
|
2021-09-21 21:54:55 +02:00
|
|
|
- name: Prepare artifact
|
|
|
|
if: ${{ matrix.artifact }}
|
|
|
|
run: |
|
|
|
|
strip bin/godot.*
|
2022-08-25 14:11:54 +02:00
|
|
|
chmod +x bin/godot.*
|
2021-09-21 21:54:55 +02:00
|
|
|
|
2021-09-01 17:26:01 +02:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: ./.github/actions/upload-artifact
|
|
|
|
if: ${{ matrix.artifact }}
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.cache-name }}
|