Skip to content

Commit

Permalink
Merge pull request LandSandBoat#6604 from LandSandBoat/update_ci_mach…
Browse files Browse the repository at this point in the history
…ines

CI: Update compilers to ubuntu 24.04 newest
  • Loading branch information
zach2good authored Dec 29, 2024
2 parents e546062 + 23b7d9a commit 1932654
Show file tree
Hide file tree
Showing 39 changed files with 153 additions and 131 deletions.
129 changes: 72 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

# Available machines:
# https://github.com/actions/runner-images/tree/main

jobs:
Sanity_Checks:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
# TODO: Properly use python venv
run: |
python3 -m pip config set global.break-system-packages true
sudo apt-get update
sudo apt-get install -y software-properties-common cppcheck luajit-5.1-dev luarocks mariadb-server-10.6 mariadb-client-10.6 libmariadb-dev-compat binutils-dev
pip install -r tools/requirements.txt
sudo apt-get install -y software-properties-common cppcheck luajit-5.1-dev luarocks mariadb-server mariadb-client libmariadb-dev-compat binutils-dev
python3 -m pip install -r tools/requirements.txt
luarocks install luacheck --local
npm install -g diff-so-fancy
- id: changed-files
Expand Down Expand Up @@ -90,28 +95,28 @@ jobs:
exit 1
fi
exit 0
- name: Run CPP Formatting Checks (clang-format-15)
- name: Run CPP Formatting Checks (clang-format-18)
if: always()
run: |
clang-format-15 -version
clang-format-18 -version
touch cpp_formatting_checks.txt
for changed_file in ${{ steps.changed-files.outputs.all }}; do
if [[ -f $changed_file ]]; then
if [[ $changed_file == *.cpp || $changed_file == *.h ]]; then
clang-format-15 -style=file -i ${changed_file}
clang-format-18 -style=file -i ${changed_file}
fi
fi
done
git diff >> cpp_formatting_checks.txt
git diff --color >> cpp_formatting_checks_color.txt
- name: Upload CPP Formatting Diff (clang-format-15)
- name: Upload CPP Formatting Diff (clang-format-18)
if: hashFiles('cpp_formatting_checks.txt') != ''
uses: actions/upload-artifact@v4
with:
name: clang_format_diff
path: |
cpp_formatting_checks.txt
- name: Report CPP Formatting Checks (clang-format-15)
- name: Report CPP Formatting Checks (clang-format-18)
if: always()
run: |
if [ -s cpp_formatting_checks_color.txt ]
Expand Down Expand Up @@ -189,16 +194,18 @@ jobs:
Linux_LuaLanguageServer:
needs: Sanity_Checks
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Or else we don't get full blame information
- name: Install Dependencies
# TODO: Properly use python venv
run: |
python3 -m pip config set global.break-system-packages true
sudo apt-get update
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev binutils-dev
pip install -r tools/requirements.txt
python3 -m pip install -r tools/requirements.txt
- name: Run Lua Language Server
run: |
python3 tools/ci/lua_lang_server.py
Expand All @@ -215,9 +222,9 @@ jobs:
exit 1
fi
Linux_Clang15_64bit:
Linux_Clang18_64bit:
needs: Sanity_Checks
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -226,15 +233,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev binutils-dev
#- name: Cache 'build' folder
# uses: actions/cache@v4
# with:
# path: build
# key: ${{ runner.os }}-clang
- name: Cache 'build' folder
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-clang
- name: Configure CMake
run: |
export CC=/usr/bin/clang-15
export CXX=/usr/bin/clang++-15
export CC=/usr/bin/clang-18
export CXX=/usr/bin/clang++-18
mkdir -p build
cmake -S . -B build
- name: Build
Expand All @@ -250,30 +257,30 @@ jobs:
xi_search
xi_world
Linux_ClangTidy15_64bit:
Linux_ClangTidy18_64bit:
needs: Sanity_Checks
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
# workaround for broken clang on ubuntu runner until fixed: https://github.com/actions/runner-images/issues/8659
- uses: claywar/workaround8649@4892524a133793c85e25513fae79fc968e63877c
with:
os: ubuntu-22.04
os: ubuntu-24.04
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev binutils-dev
#- name: Cache 'build' folder
# uses: actions/cache@v4
# with:
# path: build
# key: ${{ runner.os }}-clang
- name: Cache 'build' folder
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-clang-tidy
- name: Configure CMake
run: |
export CC=/usr/bin/clang-15
export CXX=/usr/bin/clang++-15
export CC=/usr/bin/clang-18
export CXX=/usr/bin/clang++-18
mkdir -p build
cmake -S . -B build -DENABLE_CLANG_TIDY=ON
- name: Build
Expand All @@ -285,9 +292,9 @@ jobs:
exit 1
fi
Linux_GCC13_64bit:
Linux_GCC14_64bit:
needs: Sanity_Checks
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -300,17 +307,17 @@ jobs:
# Required for 22.04 Image, remove on transition to 24.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install gcc-13 g++-13
sudo apt-get install gcc-14 g++-14
#- name: Cache 'build' folder
# uses: actions/cache@v4
# with:
# path: build
# key: ${{ runner.os }}-gcc
- name: Cache 'build' folder
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-gcc
- name: Configure CMake
run: |
export CC=/usr/bin/gcc-13
export CXX=/usr/bin/g++-13
export CC=/usr/bin/gcc-14
export CXX=/usr/bin/g++-14
mkdir -p build
CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 cmake -S . -B build
- name: Build
Expand All @@ -319,9 +326,9 @@ jobs:
Windows_64bit_Debug:
needs: Sanity_Checks
runs-on: windows-2022
runs-on: windows-2025
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -352,9 +359,9 @@ jobs:
Windows_64bit_Release_Tracy_Modules:
needs: Sanity_Checks
runs-on: windows-2022
runs-on: windows-2025
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -395,8 +402,8 @@ jobs:
MacOS_64bit:
needs: Sanity_Checks
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -413,8 +420,8 @@ jobs:
cmake --build build -j4
Full_Startup_Checks_Linux:
runs-on: ubuntu-22.04
needs: Linux_Clang15_64bit
runs-on: ubuntu-24.04
needs: Linux_Clang18_64bit
services:
mysql:
image: mariadb:10.6
Expand All @@ -433,10 +440,12 @@ jobs:
name: linux_executables
path: .
- name: Install Dependencies
# TODO: Properly use python venv
run: |
python3 -m pip config set global.break-system-packages true
sudo apt-get update
sudo apt-get install -y software-properties-common cmake mariadb-client-10.6 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks binutils-dev
pip install -r tools/requirements.txt
sudo apt-get install -y software-properties-common cmake mariadb-client libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks binutils-dev
python3 -m pip install -r tools/requirements.txt
- name: Verify MySQL connection from container
run: |
mysql -h 127.0.0.1 -uroot -proot -e "SHOW DATABASES"
Expand Down Expand Up @@ -580,8 +589,8 @@ jobs:
fi
MultiInstance_Startup_Checks_Linux:
runs-on: ubuntu-22.04
needs: Linux_Clang15_64bit
runs-on: ubuntu-24.04
needs: Linux_Clang18_64bit
services:
mysql:
image: mariadb:10.6
Expand All @@ -600,10 +609,12 @@ jobs:
name: linux_executables
path: .
- name: Install Dependencies
# TODO: Properly use python venv
run: |
python3 -m pip config set global.break-system-packages true
sudo apt-get update
sudo apt-get install -y software-properties-common cmake mariadb-client-10.6 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks binutils-dev
pip install -r tools/requirements.txt
sudo apt-get install -y software-properties-common cmake mariadb-client libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks binutils-dev
python3 -m pip install -r tools/requirements.txt
- name: Verify MySQL connection from container
run: |
mysql -h 127.0.0.1 -uroot -proot -e "SHOW DATABASES"
Expand Down Expand Up @@ -665,7 +676,7 @@ jobs:
fi
Full_Startup_Checks_Windows:
runs-on: windows-2022
runs-on: windows-2025
needs: Windows_64bit_Debug
steps:
- uses: actions/checkout@v4
Expand All @@ -682,8 +693,10 @@ jobs:
run: |
cp settings/default/* settings/
- name: Install Python Dependencies
# TODO: Properly use python venv
run: |
pip install -r tools/requirements.txt
python3 -m pip config set global.break-system-packages true
python3 -m pip install -r tools/requirements.txt
- name: Import SQL files
shell: bash
run: |
Expand All @@ -699,7 +712,7 @@ jobs:
python3 ./tools/ci/startup_checks.py
Full_Startup_Checks_Windows_Tracy_Modules:
runs-on: windows-2022
runs-on: windows-2025
needs: Windows_64bit_Release_Tracy_Modules
steps:
- uses: actions/checkout@v4
Expand All @@ -726,8 +739,10 @@ jobs:
f.write("renamer\n")
EOF
- name: Install Python Dependencies
# TODO: Properly use python venv
run: |
pip install -r tools/requirements.txt
python3 -m pip config set global.break-system-packages true
python3 -m pip install -r tools/requirements.txt
- name: Import SQL files
shell: bash
run: |
Expand Down
14 changes: 10 additions & 4 deletions cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ function(set_project_warnings project_name)
-Wno-missing-field-initializers
-Wno-sign-compare

# TODO: This is good, but it's Clang only
# -Wunused-private-field # warn on unused private fields

# TODO: -pedantic # warn if non-standard C++ is used
# TODO: -pedantic-errors # Error on language extensions
# TODO: -Wconversion # warn on type conversions that may lose data
Expand All @@ -80,7 +77,11 @@ function(set_project_warnings project_name)
)

if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
list(APPEND CLANG_WARNINGS -Wno-nan-infinity-disabled) # TODO: fmt triggers this, a combination of the fast-math flag and `isfinite`
list(APPEND
CLANG_WARNINGS
-Wno-nan-infinity-disabled # TODO: fmt triggers this, a combination of the fast-math flag and `isfinite`
-Wunused-private-field # warn on unused private fields
)
endif()

set(GCC_WARNINGS
Expand All @@ -99,10 +100,13 @@ function(set_project_warnings project_name)
)

if(MSVC)
message(STATUS "Setting MSVC compiler warnings")
set(PROJECT_WARNINGS ${MSVC_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
message(STATUS "Setting Clang compiler warnings")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "Setting GCC compiler warnings")
set(PROJECT_WARNINGS ${GCC_WARNINGS})
else()
message(AUTHOR_WARNING "No compiler warnings set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
Expand All @@ -117,5 +121,7 @@ function(set_project_warnings project_name)
endif()
endif()

message(STATUS "Setting warnings as errors flag: ${ERRORS}")
message(STATUS "Setting project warning flags: ${PROJECT_WARNINGS}")
target_compile_options(${project_name} INTERFACE ${ERRORS} ${PROJECT_WARNINGS})
endfunction() #set_project_warnings
2 changes: 1 addition & 1 deletion modules/renamer/cpp/renamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RenamerModule : public CPPModule
}

std::string dataString;
for (auto [key, value] : zoneTable)
for (const auto& [key, value] : zoneTable)
{
auto entryTable = value.as<sol::table>();

Expand Down
4 changes: 2 additions & 2 deletions src/common/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Application::Application(std::string const& serverName, int argc, char** argv)
}
catch (const std::runtime_error& err)
{
std::cerr << err.what() << std::endl;
std::cerr << *gArgParser;
std::cerr << err.what() << "\n";
std::cerr << *gArgParser << "\n";;
std::exit(1);
}

Expand Down
Loading

0 comments on commit 1932654

Please sign in to comment.