Skip to content

Commit

Permalink
CI: Update Linux runners to Ubuntu 24.04
Browse files Browse the repository at this point in the history
Pin clang-format to version 16, and black to 24.10.0.

Mono needs to be reinstalled manually as they removed it in Ubuntu 24.04 images.
(Still using the "focal" version, i.e. Ubuntu 20.04, as Mono upstream also no
longer provides new versions for Ubuntu.)
  • Loading branch information
akien-mga committed Nov 6, 2024
1 parent 960898c commit 07f1822
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 40 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@ 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 17
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/javascript_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

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

steps:
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build-linux:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -62,15 +62,21 @@ 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}*
# Mono, no longer provided in Ubuntu 24.04 images.
# https://github.com/actions/runner-images/blob/ae99c16b0cf27c0cca7ef0b08e7bcf13c33f6cfa/images/ubuntu/scripts/build/install-mono.sh
REPO_URL="https://download.mono-project.com/repo/ubuntu"
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | sudo gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-focal main" | sudo tee $REPO_PATH
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 \
libspeechd-dev speech-dispatcher
# 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 apt-transport-https mono-complete nuget
- name: Free disk space on runner
run: |
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/server_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build-server:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-24.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
Expand All @@ -36,14 +36,21 @@ 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}*
# Mono, no longer provided in Ubuntu 24.04 images.
# https://github.com/actions/runner-images/blob/ae99c16b0cf27c0cca7ef0b08e7bcf13c33f6cfa/images/ubuntu/scripts/build/install-mono.sh
REPO_URL="https://download.mono-project.com/repo/ubuntu"
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | sudo gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-focal main" | sudo tee $REPO_PATH
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 apt-transport-https mono-complete nuget
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@ 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
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"
sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install -qq dos2unix clang-format-15 libxml2-utils python3-pip moreutils
# 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-15 100
sudo pip3 install black==22.3.0 pygments
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 100
sudo pip3 install black==24.10.0 pygments
# This needs to happen before Python and npm execution; it must happen before any extra files are written.
- name: .gitignore checks (gitignore_check.sh)
Expand Down
1 change: 1 addition & 0 deletions doc/translations/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions editor/editor_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions editor/icons/editor_icons_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gles_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions main/main_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modules/denoise/resource_to_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
1 change: 1 addition & 0 deletions modules/gdnative/gdnative_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions platform/osx/platform_osx_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions platform/windows/platform_windows_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions platform/x11/platform_x11_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,8 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) {
for (int i = 0; i < c; i += offset) {
const uint8_t *ptr = (const uint8_t *)&r[i];
uint8_t local[12];
for (int j = 0; j < ((format == FORMAT_2) ? 12 : 8); j++) {
const int buffer_size = (format == FORMAT_2) ? 12 : 8;
for (int j = 0; j < buffer_size; j++) {
local[j] = ptr[j];
}

Expand Down
2 changes: 2 additions & 0 deletions scu_builders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Functions used to generate scu build source files during build time
"""

import glob, os
import math
from pathlib import Path
Expand Down Expand Up @@ -159,6 +160,7 @@ def find_section_name(sub_folder):
# which is slow like a normal build, but prevents the naming conflicts.
# Ideally in these situations, the source code should be changed to prevent naming conflicts.


# "extension" will usually be cpp, but can also be set to c (for e.g. third party libraries that use c)
def process_folder(folders, sought_exceptions=[], includes_per_scu=0, extension="cpp"):
if len(folders) == 0:
Expand Down

0 comments on commit 07f1822

Please sign in to comment.