From cb38b841afd25641c0374ab1f45e4e7245ee4cf9 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 20 Dec 2023 21:35:19 +0100 Subject: [PATCH] Split windows from linux CI workflows --- .github/workflows/android.yml | 4 + .github/workflows/linux.yml | 163 +++++++++++++++++++ .github/workflows/{build.yml => windows.yml} | 149 +---------------- 3 files changed, 173 insertions(+), 143 deletions(-) create mode 100644 .github/workflows/linux.yml rename .github/workflows/{build.yml => windows.yml} (55%) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 8cbe5e09f..ede978268 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,6 +8,8 @@ on: - 'lib/**.cpp' - 'src/**.[ch]' - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' - 'android/**' - '.github/workflows/android.yml' pull_request: @@ -16,6 +18,8 @@ on: - 'lib/**.cpp' - 'src/**.[ch]' - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' - 'android/**' - '.github/workflows/android.yml' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..2a4a79b7b --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,163 @@ +name: linux + +# build on c/cpp changes or workflow changes +on: + push: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/ci/**' + - 'misc/irrlichtmt_tag.txt' + - 'Dockerfile' + - '.dockerignore' + - '.github/workflows/linux.yml' + pull_request: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/ci/**' + - 'misc/irrlichtmt_tag.txt' + - 'Dockerfile' + - '.dockerignore' + - '.github/workflows/linux.yml' + +env: + MINETEST_POSTGRESQL_CONNECT_STRING: 'host=localhost user=minetest password=minetest dbname=minetest' + +jobs: + # Older gcc version (should be close to our minimum supported version) + gcc_7: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + source ./util/ci/common.sh + install_linux_deps g++-7 + + - name: Build + run: | + ./util/ci/build.sh + env: + CC: gcc-7 + CXX: g++-7 + + - name: Test + run: | + ./bin/minetest --run-unittests + + # Current gcc version + gcc_12: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + source ./util/ci/common.sh + install_linux_deps g++-12 libluajit-5.1-dev + + - name: Build + run: | + ./util/ci/build.sh + env: + CC: gcc-12 + CXX: g++-12 + + - name: Test + run: | + ./bin/minetest --run-unittests + + # Older clang version (should be close to our minimum supported version) + clang_7: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + source ./util/ci/common.sh + install_linux_deps clang-7 valgrind + + - name: Build + run: | + ./util/ci/build.sh + env: + CC: clang-7 + CXX: clang++-7 + + - name: Unittest + run: | + ./bin/minetest --run-unittests + + - name: Valgrind + run: | + valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests + + # Current clang version + clang_14: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + source ./util/ci/common.sh + install_linux_deps clang-14 gdb + + - name: Build + run: | + ./util/ci/build.sh + env: + CC: clang-14 + CXX: clang++-14 + + - name: Test + run: | + ./bin/minetest --run-unittests + + - name: Integration test + devtest + run: | + ./util/test_multiplayer.sh + + # Build with prometheus-cpp (server-only) + clang_9_prometheus: + name: "clang_9 (PROMETHEUS=1)" + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + source ./util/ci/common.sh + install_linux_deps clang-9 + + - name: Build prometheus-cpp + run: | + ./util/ci/build_prometheus_cpp.sh + + - name: Build + run: | + ./util/ci/build.sh + env: + CC: clang-9 + CXX: clang++-9 + CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0" + + - name: Test + run: | + ./bin/minetestserver --run-unittests + + docker: + name: "Docker image" + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Build docker image + run: | + docker build . -t minetest:latest + docker run --rm minetest:latest /usr/local/bin/minetestserver --version diff --git a/.github/workflows/build.yml b/.github/workflows/windows.yml similarity index 55% rename from .github/workflows/build.yml rename to .github/workflows/windows.yml index e67bcb7bb..7f15e841d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: build +name: windows # build on c/cpp changes or workflow changes on: @@ -11,12 +11,9 @@ on: - '**/CMakeLists.txt' - 'cmake/Modules/**' - 'util/buildbot/**' - - 'util/ci/**' - 'misc/irrlichtmt_tag.txt' - 'misc/*.manifest' - - '.github/workflows/**.yml' - - 'Dockerfile' - - '.dockerignore' + - '.github/workflows/windows.yml' pull_request: paths: - 'lib/**.[ch]' @@ -26,147 +23,12 @@ on: - '**/CMakeLists.txt' - 'cmake/Modules/**' - 'util/buildbot/**' - - 'util/ci/**' - 'misc/irrlichtmt_tag.txt' - 'misc/*.manifest' - - '.github/workflows/**.yml' - - 'Dockerfile' - - '.dockerignore' - -env: - MINETEST_POSTGRESQL_CONNECT_STRING: 'host=localhost user=minetest password=minetest dbname=minetest' + - '.github/workflows/windows.yml' jobs: - # Older gcc version (should be close to our minimum supported version) - gcc_7: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Install deps - run: | - source ./util/ci/common.sh - install_linux_deps g++-7 - - - name: Build - run: | - ./util/ci/build.sh - env: - CC: gcc-7 - CXX: g++-7 - - - name: Test - run: | - ./bin/minetest --run-unittests - - # Current gcc version - gcc_12: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install deps - run: | - source ./util/ci/common.sh - install_linux_deps g++-12 libluajit-5.1-dev - - - name: Build - run: | - ./util/ci/build.sh - env: - CC: gcc-12 - CXX: g++-12 - - - name: Test - run: | - ./bin/minetest --run-unittests - - # Older clang version (should be close to our minimum supported version) - clang_7: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Install deps - run: | - source ./util/ci/common.sh - install_linux_deps clang-7 valgrind - - - name: Build - run: | - ./util/ci/build.sh - env: - CC: clang-7 - CXX: clang++-7 - - - name: Unittest - run: | - ./bin/minetest --run-unittests - - - name: Valgrind - run: | - valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests - - # Current clang version - clang_14: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install deps - run: | - source ./util/ci/common.sh - install_linux_deps clang-14 gdb - - - name: Build - run: | - ./util/ci/build.sh - env: - CC: clang-14 - CXX: clang++-14 - - - name: Test - run: | - ./bin/minetest --run-unittests - - - name: Integration test + devtest - run: | - ./util/test_multiplayer.sh - - # Build with prometheus-cpp (server-only) - clang_9_prometheus: - name: "clang_9 (PROMETHEUS=1)" - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Install deps - run: | - source ./util/ci/common.sh - install_linux_deps clang-9 - - - name: Build prometheus-cpp - run: | - ./util/ci/build_prometheus_cpp.sh - - - name: Build - run: | - ./util/ci/build.sh - env: - CC: clang-9 - CXX: clang++-9 - CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0" - - - name: Test - run: | - ./bin/minetestserver --run-unittests - - docker: - name: "Docker image" - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Build docker image - run: | - docker build . -t minetest:latest - docker run --rm minetest:latest /usr/local/bin/minetestserver --version - - win32: + mingw32: name: "MinGW cross-compiler (32-bit)" runs-on: ubuntu-22.04 steps: @@ -186,7 +48,7 @@ jobs: path: B/build/*.zip if-no-files-found: error - win64: + mingw64: name: "MinGW cross-compiler (64-bit)" runs-on: ubuntu-22.04 steps: @@ -282,3 +144,4 @@ jobs: with: name: msvc-${{ matrix.config.arch }}-${{ matrix.type }} path: .\Package\ + if-no-files-found: error