Update some workflows to newer Ubuntu versions (#14668)

This commit is contained in:
sfan5 2024-06-03 20:39:02 +02:00 committed by GitHub
parent ec9c000be9
commit 87232358d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 45 additions and 52 deletions

@ -29,13 +29,13 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps - name: Install deps
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext openjdk-11-jdk-headless sudo apt-get install -y --no-install-recommends gettext openjdk-17-jdk-headless
- name: Build AAB with Gradle - name: Build AAB with Gradle
# We build an AAB as well for uploading to the the Play Store. # We build an AAB as well for uploading to the the Play Store.
run: cd android; ./gradlew bundlerelease run: cd android; ./gradlew bundlerelease

@ -57,21 +57,21 @@ jobs:
./bin/minetest --run-unittests ./bin/minetest --run-unittests
# Current gcc version # Current gcc version
gcc_12: gcc_14:
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps - name: Install deps
run: | run: |
source ./util/ci/common.sh source ./util/ci/common.sh
install_linux_deps g++-12 libluajit-5.1-dev install_linux_deps g++-14 libluajit-5.1-dev
- name: Build - name: Build
run: | run: |
./util/ci/build.sh ./util/ci/build.sh
env: env:
CC: gcc-12 CC: gcc-14
CXX: g++-12 CXX: g++-14
- name: Test - name: Test
run: | run: |
@ -103,21 +103,21 @@ jobs:
./bin/minetest --run-unittests ./bin/minetest --run-unittests
# Current clang version # Current clang version
clang_14: clang_18:
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps - name: Install deps
run: | run: |
source ./util/ci/common.sh source ./util/ci/common.sh
install_linux_deps clang-14 lldb install_linux_deps clang-18 lldb
- name: Build - name: Build
run: | run: |
./util/ci/build.sh ./util/ci/build.sh
env: env:
CC: clang-14 CC: clang-18
CXX: clang++-14 CXX: clang++-18
- name: Test - name: Test
run: | run: |
@ -128,27 +128,26 @@ jobs:
./util/test_multiplayer.sh ./util/test_multiplayer.sh
# Build with prometheus-cpp (server-only) # Build with prometheus-cpp (server-only)
clang_9_prometheus: clang_11_prometheus:
name: "clang_9 (PROMETHEUS=1)" name: "clang_11 (PROMETHEUS=1)"
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps - name: Install deps
run: | run: |
source ./util/ci/common.sh source ./util/ci/common.sh
install_linux_deps clang-9 install_linux_deps clang-11
- name: Build prometheus-cpp - name: Build prometheus-cpp
run: | run: ./util/ci/build_prometheus_cpp.sh
./util/ci/build_prometheus_cpp.sh
- name: Build - name: Build
run: | run: |
./util/ci/build.sh ./util/ci/build.sh
env: env:
CC: clang-9 CC: clang-11
CXX: clang++-9 CXX: clang++-11
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0" CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0 -DENABLE_CURSES=0"
- name: Test - name: Test
run: | run: |

@ -17,7 +17,7 @@ jobs:
# Note that the integration tests are also run in build.yml, but only when C++ code is changed. # Note that the integration tests are also run in build.yml, but only when C++ code is changed.
integration_tests: integration_tests:
name: "Compile and run multiplayer tests" name: "Compile and run multiplayer tests"
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install deps - name: Install deps
@ -39,7 +39,7 @@ jobs:
luacheck: luacheck:
name: "Builtin Luacheck and Unit Tests" name: "Builtin Luacheck and Unit Tests"
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
@ -50,11 +50,7 @@ jobs:
- uses: leafo/gh-actions-luarocks@v4.3.0 - uses: leafo/gh-actions-luarocks@v4.3.0
- name: Install LuaJIT - name: Install LuaJIT
run: | run: ./util/ci/build_luajit.sh
cd $HOME
git clone https://github.com/LuaJIT/LuaJIT/
cd LuaJIT
make -j$(nproc)
- name: Install luarocks tools - name: Install luarocks tools
run: | run: |

@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "exceptions.h" #include "exceptions.h"
#include "util/numeric.h" #include "util/numeric.h"
#include <optional> #include <optional>
#include <algorithm>
std::string ModConfiguration::getUnsatisfiedModsError() const std::string ModConfiguration::getUnsatisfiedModsError() const
{ {

@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h" #include "porting.h"
#include "settings.h" #include "settings.h"
#include <algorithm>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

6
util/ci/build_luajit.sh Executable file

@ -0,0 +1,6 @@
#!/bin/bash -eu
cd $HOME
git clone --depth 1 https://github.com/LuaJIT/LuaJIT
pushd LuaJIT
make -j$(nproc)
popd

@ -1,7 +1,7 @@
#! /bin/bash -eu #!/bin/bash -eu
cd /tmp cd /tmp
git clone --recursive https://github.com/jupp0r/prometheus-cpp git clone --recursive --depth 1 --shallow-submodules \
https://github.com/jupp0r/prometheus-cpp
mkdir prometheus-cpp/build mkdir prometheus-cpp/build
cd prometheus-cpp/build cd prometheus-cpp/build
cmake .. \ cmake .. \

@ -4,7 +4,7 @@
install_linux_deps() { install_linux_deps() {
local pkgs=( local pkgs=(
cmake gettext postgresql cmake gettext postgresql
libpng-dev libjpeg-dev libgl1-mesa-dev libsdl2-dev libpng-dev libjpeg-dev libgl1-mesa-dev libsdl2-dev libfreetype-dev
libsqlite3-dev libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libsqlite3-dev libhiredis-dev libogg-dev libgmp-dev libvorbis-dev
libopenal-dev libpq-dev libleveldb-dev libcurl4-openssl-dev libzstd-dev libopenal-dev libpq-dev libleveldb-dev libcurl4-openssl-dev libzstd-dev
) )
@ -12,11 +12,16 @@ install_linux_deps() {
sudo apt-get update sudo apt-get update
sudo apt-get install -y --no-install-recommends "${pkgs[@]}" "$@" sudo apt-get install -y --no-install-recommends "${pkgs[@]}" "$@"
# set up Postgres for unit tests
if [ -n "$MINETEST_POSTGRESQL_CONNECT_STRING" ]; then
sudo systemctl start postgresql.service sudo systemctl start postgresql.service
sudo -u postgres psql <<<" sudo -u postgres psql <<<"
CREATE USER minetest WITH PASSWORD 'minetest'; CREATE USER minetest WITH PASSWORD 'minetest';
CREATE DATABASE minetest; CREATE DATABASE minetest;
\c minetest
GRANT ALL ON SCHEMA public TO minetest;
" "
fi
} }
# macOS build only # macOS build only

@ -1,15 +0,0 @@
#!/bin/sh -e
name=${CONTAINER_IMAGE}/server
# build and publish Docker image (gitlab-ci)
docker build . \
-t ${name}:${CI_COMMIT_SHA} \
-t ${name}:${CI_COMMIT_REF_NAME} \
-t ${name}:latest
docker push ${name}:${CI_COMMIT_SHA}
docker push ${name}:${CI_COMMIT_REF_NAME}
[ "$CI_COMMIT_BRANCH" = master ] && docker push ${name}:latest
exit 0