diff --git a/.github/actions/godot-cache/action.yml b/.github/actions/godot-cache-restore/action.yml similarity index 77% rename from .github/actions/godot-cache/action.yml rename to .github/actions/godot-cache-restore/action.yml index e54e6064a73a..614a98330d47 100644 --- a/.github/actions/godot-cache/action.yml +++ b/.github/actions/godot-cache-restore/action.yml @@ -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). @@ -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}} diff --git a/.github/actions/godot-cache-save/action.yml b/.github/actions/godot-cache-save/action.yml new file mode 100644 index 000000000000..bb3f18ad85a1 --- /dev/null +++ b/.github/actions/godot-cache-save/action.yml @@ -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}} diff --git a/.github/actions/godot-deps/action.yml b/.github/actions/godot-deps/action.yml index 881eb7d1f683..cac72c436ed3 100644 --- a/.github/actions/godot-deps/action.yml +++ b/.github/actions/godot-deps/action.yml @@ -23,5 +23,5 @@ runs: shell: bash run: | python -c "import sys; print(sys.version)" - python -m pip install scons==4.4.0 + python -m pip install scons==4.7.0 scons --version diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index ee4e34c71e09..b1233391980c 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -14,27 +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 + - name: Set up Java 17 uses: actions/setup-java@v4 with: distribution: temurin - java-version: 11 + java-version: 17 - - 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 @@ -56,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 diff --git a/.github/workflows/ios_builds.yml b/.github/workflows/ios_builds.yml index 8c65167961cf..00fcac40ec90 100644 --- a/.github/workflows/ios_builds.yml +++ b/.github/workflows/ios_builds.yml @@ -20,8 +20,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 continue-on-error: true - name: Setup python and scons @@ -35,5 +35,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 diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index 11e25da2f96c..381e1f6185d7 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -16,7 +16,7 @@ concurrency: jobs: javascript-template: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" name: Template (target=release, tools=no) steps: @@ -33,8 +33,8 @@ jobs: 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 @@ -48,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 diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 6bcb2ee7a6f1..d097b42e34ac 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -14,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 @@ -54,17 +55,23 @@ 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 \ + libspeechd-dev speech-dispatcher - - 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 @@ -83,6 +90,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 }} @@ -103,9 +116,9 @@ jobs: - name: Download test project if: ${{ matrix.test }} run: | - wget https://github.com/godotengine/regression-test-project/archive/3.x.zip - unzip 3.x.zip - mv "regression-test-project-3.x" "test_project" + wget https://github.com/godotengine/regression-test-project/archive/3.5.zip + unzip 3.5.zip + mv "regression-test-project-3.5" "test_project" # Editor is quite complicated piece of software, so it is easy to introduce bug here - name: Open and close editor diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 1790284c3050..021f09a6f124 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -34,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 @@ -51,6 +51,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 + - name: Prepare artifact run: | strip bin/godot.* diff --git a/.github/workflows/server_builds.yml b/.github/workflows/server_builds.yml index 9f34041ce23a..02e2ea9acdae 100644 --- a/.github/workflows/server_builds.yml +++ b/.github/workflows/server_builds.yml @@ -14,7 +14,8 @@ concurrency: jobs: build-server: - 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 @@ -36,17 +37,17 @@ 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 \ + libspeechd-dev speech-dispatcher - - 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 @@ -61,3 +62,9 @@ jobs: platform: server 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 diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 082ebdebfa56..4d4f949e3eb7 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -9,26 +9,25 @@ concurrency: jobs: static-checks: name: Static Checks (clang-format, black format, file format, documentation checks) - runs-on: ubuntu-20.04 + runs-on: "ubuntu-24.04" steps: - name: Checkout 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 + - name: Install dependencies run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" + # Azure repositories are flaky, remove them. + sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}* sudo apt-get update + sudo apt-get install -qq dos2unix libxml2-utils python3-pip moreutils + sudo update-alternatives --remove-all clang-format || true + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 100 + sudo pip3 install black==24.10.0 pygments - - name: Install dependencies + # This needs to happen before Python and npm execution; it must happen before any extra files are written. + - name: .gitignore checks (gitignore_check.sh) run: | - sudo apt-get install -qq dos2unix clang-format-15 libxml2-utils python3-pip moreutils - sudo update-alternatives --remove-all clang-format || true - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 100 - sudo pip3 install black==22.3.0 pygments + bash ./misc/scripts/gitignore_check.sh - name: File formatting checks (file_format.sh) run: | diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 99b02a05261e..339d5a734cfb 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -37,8 +37,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 @@ -57,6 +57,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 + - name: Prepare artifact run: | Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force diff --git a/doc/translations/extract.py b/doc/translations/extract.py index 6208468509f6..e14c6d1b5c3c 100644 --- a/doc/translations/extract.py +++ b/doc/translations/extract.py @@ -59,6 +59,7 @@ sys.modules["_elementtree"] = None import xml.etree.ElementTree as ET + ## override the parser to get the line number class LineNumberingParser(ET.XMLParser): def _start(self, *args, **kwargs): diff --git a/editor/editor_builders.py b/editor/editor_builders.py index 54fc20ca4bcb..bcd1bc071f76 100644 --- a/editor/editor_builders.py +++ b/editor/editor_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os import os.path import shutil diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py index ce6b9a8686ab..dd910a6810b8 100644 --- a/editor/icons/editor_icons_builders.py +++ b/editor/icons/editor_icons_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main from compat import StringIO diff --git a/gles_builders.py b/gles_builders.py index f43b3b850088..a8effa75fd06 100644 --- a/gles_builders.py +++ b/gles_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + from platform_methods import subprocess_main import re diff --git a/main/main_builders.py b/main/main_builders.py index 6e5a5ceede4f..d8334f3b7a58 100644 --- a/main/main_builders.py +++ b/main/main_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + from platform_methods import subprocess_main from compat import byte_to_str from collections import OrderedDict diff --git a/misc/scripts/file_format.sh b/misc/scripts/file_format.sh index 86a84cf30701..d6c671783782 100755 --- a/misc/scripts/file_format.sh +++ b/misc/scripts/file_format.sh @@ -28,7 +28,9 @@ while IFS= read -rd '' f; do continue elif [[ "$f" == *"po" ]]; then continue - elif [[ "$f" == "thirdparty"* ]]; then + elif [[ "$f" == "thirdparty/"* ]]; then + continue + elif [[ "$f" == *"/thirdparty/"* ]]; then continue elif [[ "$f" == "platform/android/java/lib/src/com/google"* ]]; then continue diff --git a/misc/scripts/gitignore_check.sh b/misc/scripts/gitignore_check.sh new file mode 100644 index 000000000000..f162e25391b0 --- /dev/null +++ b/misc/scripts/gitignore_check.sh @@ -0,0 +1,26 @@ +set -uo pipefail +shopt -s globstar + +echo -e ".gitignore validation..." + +# Get a list of files that exist in the repo but are ignored. + +# The --verbose flag also includes files un-ignored via ! prefixes. +# We filter those out with a somewhat awkward `awk` directive. + # (Explanation: Split each line by : delimiters, + # see if the actual gitignore line shown in the third field starts with !, + # if it doesn't, print it.) + +# ignorecase for the sake of Windows users. + +output=$(git -c core.ignorecase=true check-ignore --verbose --no-index **/* | \ + awk -F ':' '{ if ($3 !~ /^!/) print $0 }') + +# Then we take this result and return success if it's empty. +if [ -z "$output" ]; then + exit 0 +else + # And print the result if it isn't. + echo "$output" + exit 1 +fi diff --git a/modules/denoise/resource_to_cpp.py b/modules/denoise/resource_to_cpp.py index 6c8327735599..307ea0ee7ded 100644 --- a/modules/denoise/resource_to_cpp.py +++ b/modules/denoise/resource_to_cpp.py @@ -19,6 +19,7 @@ import os from array import array + # Generates a C++ file from the specified binary resource file def generate(in_path, out_path): diff --git a/modules/gdnative/gdnative_builders.py b/modules/gdnative/gdnative_builders.py index d44bf452144a..fa9c42239456 100644 --- a/modules/gdnative/gdnative_builders.py +++ b/modules/gdnative/gdnative_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import json from platform_methods import subprocess_main diff --git a/platform/osx/platform_osx_builders.py b/platform/osx/platform_osx_builders.py index 953ed479db36..d60f78884a09 100644 --- a/platform/osx/platform_osx_builders.py +++ b/platform/osx/platform_osx_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main diff --git a/platform/windows/platform_windows_builders.py b/platform/windows/platform_windows_builders.py index 22e33b51b490..0d518e31c437 100644 --- a/platform/windows/platform_windows_builders.py +++ b/platform/windows/platform_windows_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main diff --git a/platform/x11/platform_x11_builders.py b/platform/x11/platform_x11_builders.py index 5884f8e16118..632bafce020d 100644 --- a/platform/x11/platform_x11_builders.py +++ b/platform/x11/platform_x11_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main