diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-20 20:18:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 20:18:40 +0200 |
commit | 27a485a472706bededf38f0de2630688739ca0b2 (patch) | |
tree | a9eebf3c383e68d5856eddf1c608a427f2d7445b /util | |
parent | 338195ff250bd7552ef8167348de2eb05e421c29 (diff) | |
download | minetest-27a485a472706bededf38f0de2630688739ca0b2.tar.gz minetest-27a485a472706bededf38f0de2630688739ca0b2.tar.bz2 minetest-27a485a472706bededf38f0de2630688739ca0b2.zip |
Replace travis with github actions (#9641)
* Move outside of travis to Github actions
This will permit to have better integrated CI workflow than the previous
travis one.
Diffstat (limited to 'util')
-rwxr-xr-x | util/buildbot/buildwin32.sh | 9 | ||||
-rwxr-xr-x | util/buildbot/buildwin64.sh | 9 | ||||
-rwxr-xr-x | util/ci/build.sh | 8 | ||||
-rw-r--r-- | util/ci/clang-format-whitelist.txt (renamed from util/travis/clang-format-whitelist.txt) | 1 | ||||
-rwxr-xr-x | util/ci/clang-tidy.sh | 18 | ||||
-rw-r--r-- | util/ci/common.sh (renamed from util/travis/common.sh) | 18 | ||||
-rw-r--r-- | util/ci/lint.sh (renamed from util/travis/lint.sh) | 2 | ||||
-rwxr-xr-x | util/ci/run-clang-tidy.py (renamed from util/travis/run-clang-tidy.py) | 0 | ||||
-rwxr-xr-x | util/travis/before_install.sh | 29 | ||||
-rwxr-xr-x | util/travis/clangtidy.sh | 28 | ||||
-rwxr-xr-x | util/travis/script.sh | 69 | ||||
-rw-r--r-- | util/travis/toolchain_mingw.cmake.in | 18 |
12 files changed, 39 insertions, 170 deletions
diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index 090ac7b0d..e62d32969 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -86,22 +86,21 @@ cd $libdir # Get minetest cd $builddir if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then - ln -s $EXISTING_MINETEST_DIR $CORE_NAME + cd /$EXISTING_MINETEST_DIR # must be absolute path else [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT) + cd $CORE_NAME fi -cd $CORE_NAME git_hash=$(git rev-parse --short HEAD) # Get minetest_game -cd games if [ "x$NO_MINETEST_GAME" = "x" ]; then + cd games [ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT) + cd .. fi -cd ../.. # Build the thing -cd $CORE_NAME [ -d _build ] && rm -Rf _build/ mkdir _build cd _build diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index b24a478d8..94e009c29 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -78,22 +78,21 @@ cd $libdir # Get minetest cd $builddir if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then - ln -s $EXISTING_MINETEST_DIR $CORE_NAME + cd /$EXISTING_MINETEST_DIR # must be absolute path else [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT) + cd $CORE_NAME fi -cd $CORE_NAME git_hash=$(git rev-parse --short HEAD) # Get minetest_game -cd games if [ "x$NO_MINETEST_GAME" = "x" ]; then + cd games [ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT) + cd .. fi -cd ../.. # Build the thing -cd $CORE_NAME [ -d _build ] && rm -Rf _build/ mkdir _build cd _build diff --git a/util/ci/build.sh b/util/ci/build.sh new file mode 100755 index 000000000..59069b00a --- /dev/null +++ b/util/ci/build.sh @@ -0,0 +1,8 @@ +#! /bin/bash -eu + +mkdir cmakebuild +cd cmakebuild +cmake -DCMAKE_BUILD_TYPE=Debug \ + -DRUN_IN_PLACE=TRUE -DENABLE_GETTEXT=TRUE \ + -DBUILD_SERVER=TRUE ${CMAKE_FLAGS} .. +make -j2 diff --git a/util/travis/clang-format-whitelist.txt b/util/ci/clang-format-whitelist.txt index 02c8b2660..3334257ae 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/ci/clang-format-whitelist.txt @@ -434,6 +434,7 @@ src/threading/thread.cpp src/threading/thread.h src/threads.h src/tileanimation.cpp +src/tileanimation.h src/tool.cpp src/tool.h src/translation.cpp diff --git a/util/ci/clang-tidy.sh b/util/ci/clang-tidy.sh new file mode 100755 index 000000000..d048f54ee --- /dev/null +++ b/util/ci/clang-tidy.sh @@ -0,0 +1,18 @@ +#! /bin/bash -eu + +mkdir -p cmakebuild +cd cmakebuild +cmake -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DRUN_IN_PLACE=TRUE \ + -DENABLE_GETTEXT=TRUE \ + -DENABLE_SOUND=FALSE \ + -DBUILD_SERVER=TRUE .. +make GenerateVersion + +cd .. + +./util/ci/run-clang-tidy.py \ + -clang-tidy-binary=clang-tidy-9 -p cmakebuild \ + -quiet -config="$(cat .clang-tidy)" \ + 'src/.*' diff --git a/util/travis/common.sh b/util/ci/common.sh index cf9ce020e..5a4f78457 100644 --- a/util/travis/common.sh +++ b/util/ci/common.sh @@ -21,9 +21,10 @@ install_linux_deps() { local pkgs=(libirrlicht-dev cmake libbz2-dev libpng-dev \ libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \ libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ - gettext libpq-dev postgresql-server-dev-all libleveldb-dev) + gettext libpq-dev postgresql-server-dev-all libleveldb-dev \ + libcurl4-openssl-dev) # for better coverage, build some jobs with luajit - if [[ "$CC" == "clang"* && -z "$VALGRIND$FREETYPE" ]]; then + if [ -n "$WITH_LUAJIT" ]; then pkgs+=(libluajit-5.1-dev) fi @@ -42,16 +43,3 @@ install_macosx_deps() { fi #brew upgrade postgresql } - -# Relative to git-repository root: -TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" - -needs_compile() { - RANGE="$TRAVIS_COMMIT_RANGE" - if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then - RANGE="$TRAVIS_COMMIT^...$TRAVIS_COMMIT" - echo "Fixed range: $RANGE" - fi - git diff --name-only $RANGE -- | egrep -q "^($TRIGGER_COMPILE_PATHS)" -} - diff --git a/util/travis/lint.sh b/util/ci/lint.sh index b3027c689..395445ca7 100644 --- a/util/travis/lint.sh +++ b/util/ci/lint.sh @@ -5,7 +5,7 @@ function perform_lint() { CLANG_FORMAT=clang-format fi echo "LINT: Using binary $CLANG_FORMAT" - CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" + CLANG_FORMAT_WHITELIST="util/ci/clang-format-whitelist.txt" files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" diff --git a/util/travis/run-clang-tidy.py b/util/ci/run-clang-tidy.py index 6ad0ff24f..6ad0ff24f 100755 --- a/util/travis/run-clang-tidy.py +++ b/util/ci/run-clang-tidy.py diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh deleted file mode 100755 index 649486dad..000000000 --- a/util/travis/before_install.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -e - -echo "Preparing for $TRAVIS_COMMIT_RANGE" - -. util/travis/common.sh - -if [[ ! -z "${CLANG_FORMAT}" ]]; then - exit 0 -fi - -needs_compile || exit 0 - -if [[ $PLATFORM == "Unix" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then - if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then - install_linux_deps - else - install_macosx_deps - fi -elif [[ $PLATFORM == "Win32" ]]; then - wget http://minetest.kitsunemimi.pw/mingw-w64-i686_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz - # buildwin32.sh detects the installed toolchain automatically - sudo tar -xaf mingw.tar.xz -C /usr -elif [[ $PLATFORM == "Win64" ]]; then - wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz - sed -e "s|%PREFIX%|x86_64-w64-mingw32|" \ - -e "s|%ROOTPATH%|/usr/x86_64-w64-mingw32|" \ - < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw64.cmake - sudo tar -xaf mingw.tar.xz -C /usr -fi diff --git a/util/travis/clangtidy.sh b/util/travis/clangtidy.sh deleted file mode 100755 index ed6523b0b..000000000 --- a/util/travis/clangtidy.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -e -. util/travis/common.sh - -needs_compile || exit 0 - -if [ -z "${CLANG_TIDY}" ]; then - CLANG_TIDY=clang-tidy -fi - -mkdir -p cmakebuild && cd cmakebuild -cmake -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DRUN_IN_PLACE=TRUE \ - -DENABLE_GETTEXT=TRUE \ - -DENABLE_SOUND=FALSE \ - -DBUILD_SERVER=TRUE .. -make GenerateVersion -cd .. - -echo "Performing clang-tidy checks..." -./util/travis/run-clang-tidy.py \ - -clang-tidy-binary=${CLANG_TIDY} -p cmakebuild \ - -quiet -config="$(cat .clang-tidy)" \ - 'src/.*' - -RET=$? -echo "Clang tidy returned $RET" -exit $RET diff --git a/util/travis/script.sh b/util/travis/script.sh deleted file mode 100755 index 19aa2fdf7..000000000 --- a/util/travis/script.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -e -. util/travis/common.sh -. util/travis/lint.sh - -needs_compile || exit 0 - -if [[ ! -z "${CLANG_FORMAT}" ]]; then - # Lint and exit CI - perform_lint - exit 0 -fi - -set_linux_compiler_env - -if [[ ${PLATFORM} == "Unix" ]]; then - mkdir -p travisbuild - cd travisbuild || exit 1 - - CMAKE_FLAGS='' - - if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then - CMAKE_FLAGS+=' -DCUSTOM_GETTEXT_PATH=/usr/local/opt/gettext' - fi - - if [[ -n "${FREETYPE}" ]] && [[ "${FREETYPE}" == "0" ]]; then - CMAKE_FLAGS+=' -DENABLE_FREETYPE=0' - fi - - cmake -DCMAKE_BUILD_TYPE=Debug \ - -DRUN_IN_PLACE=TRUE \ - -DENABLE_GETTEXT=TRUE \ - -DBUILD_SERVER=TRUE \ - ${CMAKE_FLAGS} .. - make -j2 - - echo "Running unit tests." - CMD="../bin/minetest --run-unittests" - if [[ "${VALGRIND}" == "1" ]]; then - valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ${CMD} && exit 0 - else - ${CMD} && exit 0 - fi - -elif [[ $PLATFORM == Win* ]]; then - [[ $CC == "clang" ]] && exit 1 # Not supposed to happen - # We need to have our build directory outside of the minetest directory because - # CMake will otherwise get very very confused with symlinks and complain that - # something is not a subdirectory of something even if it actually is. - # e.g.: - # /home/travis/minetest/minetest/travisbuild/minetest - # \/ \/ \/ - # /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest - # \/ \/ \/ - # /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest/travisbuild/minetest - # You get the idea. - OLDDIR=$(pwd) - cd .. - export EXISTING_MINETEST_DIR=$OLDDIR - export NO_MINETEST_GAME=1 - if [[ $PLATFORM == "Win32" ]]; then - "$OLDDIR/util/buildbot/buildwin32.sh" travisbuild && exit 0 - elif [[ $PLATFORM == "Win64" ]]; then - "$OLDDIR/util/buildbot/buildwin64.sh" travisbuild && exit 0 - fi -else - echo "Unknown platform \"${PLATFORM}\"." - exit 1 -fi - diff --git a/util/travis/toolchain_mingw.cmake.in b/util/travis/toolchain_mingw.cmake.in deleted file mode 100644 index 65f67517e..000000000 --- a/util/travis/toolchain_mingw.cmake.in +++ /dev/null @@ -1,18 +0,0 @@ -# Target operating system name -set(CMAKE_SYSTEM_NAME Windows) - -# Compilers to use -set(CMAKE_C_COMPILER %PREFIX%-gcc) -set(CMAKE_CXX_COMPILER %PREFIX%-g++) -set(CMAKE_RC_COMPILER %PREFIX%-windres) - -# Location of the target environment -set(CMAKE_FIND_ROOT_PATH %ROOTPATH%) - -# Adjust the default behaviour of the FIND_XXX() commands: -# search for headers and libraries in the target environment, -# search for programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - |