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 | |
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.
-rw-r--r-- | .github/workflows/build.yml | 171 | ||||
-rw-r--r-- | .github/workflows/cpp_lint.yml | 53 | ||||
-rw-r--r-- | .github/workflows/lua_lint.yml | 32 | ||||
-rw-r--r-- | .gitlab-ci.yml | 5 | ||||
-rw-r--r-- | .travis.yml | 98 | ||||
-rw-r--r-- | README.md | 2 | ||||
-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 |
18 files changed, 296 insertions, 274 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..0d559b197 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,171 @@ +name: build + +# build on c/cpp changes or workflow changes +on: + push: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/buildbot/**' + - 'util/ci/**' + - '.github/workflows/**.yml' + pull_request: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/buildbot/**' + - 'util/ci/**' + - '.github/workflows/**.yml' + +jobs: + # This is our minor gcc compiler + gcc_6: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + sudo apt-get install g++-6 gcc-6 -qyy + source ./util/ci/common.sh + install_linux_deps + + - name: Build + run: | + ./util/ci/build.sh + env: + CMAKE_FLAGS: "-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6" + + - name: Test + run: | + ./bin/minetest --run-unittests + + # This is the current gcc compiler (available in bionic) + gcc_8: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + sudo apt-get install g++-8 gcc-8 -qyy + source ./util/ci/common.sh + install_linux_deps + + - name: Build + run: | + ./util/ci/build.sh + env: + CMAKE_FLAGS: "-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8" + + - name: Test + run: | + ./bin/minetest --run-unittests + + # This is our minor clang compiler + clang_3_9: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + sudo apt-get install clang-3.9 -qyy + source ./util/ci/common.sh + install_linux_deps + + - name: Build + run: | + ./util/ci/build.sh + env: + CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-3.9 -DCMAKE_CXX_COMPILER=clang++-3.9" + + - name: Test + run: | + ./bin/minetest --run-unittests + + # This is the current clang version + clang_9: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + sudo apt-get install clang-9 valgrind -qyy + source ./util/ci/common.sh + install_linux_deps + env: + WITH_LUAJIT: 1 + + - name: Build + run: | + ./util/ci/build.sh + env: + CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9" + + - name: Test + 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 + + + # Some builds doesn't require freetype, ensure it compiled properly + clang_9_no_freetype: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + sudo apt-get install clang-9 -qyy + source ./util/ci/common.sh + install_linux_deps + + - name: Build + run: | + ./util/ci/build.sh + env: + CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 -DENABLE_FREETYPE=0" + + - name: Test + run: | + ./bin/minetest --run-unittests + + win32: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + wget http://minetest.kitsunemimi.pw/mingw-w64-i686_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz + sudo tar -xaf mingw.tar.xz -C /usr + + - name: Build + run: | + EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild + env: + NO_MINETEST_GAME: 1 + NO_PACKAGE: 1 + + win64: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install compiler + run: | + wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz + sudo tar -xaf mingw.tar.xz -C /usr + + - name: Build + run: | + EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild + env: + NO_MINETEST_GAME: 1 + NO_PACKAGE: 1 diff --git a/.github/workflows/cpp_lint.yml b/.github/workflows/cpp_lint.yml new file mode 100644 index 000000000..3044d5186 --- /dev/null +++ b/.github/workflows/cpp_lint.yml @@ -0,0 +1,53 @@ +name: cpp_lint + +# lint on c/cpp changes or workflow changes +on: + push: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/ci/**' + - '.github/workflows/**.yml' + pull_request: + paths: + - 'lib/**.[ch]' + - 'lib/**.cpp' + - 'src/**.[ch]' + - 'src/**.cpp' + - '**/CMakeLists.txt' + - 'cmake/Modules/**' + - 'util/ci/**' + - '.github/workflows/**.yml' + +jobs: + clang_format: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install clang-format + run: | + sudo apt-get install ${CLANG_FORMAT} -qyy + env: + CLANG_FORMAT: clang-format-9 + - name: Run clang-format + run: | + source ./util/ci/lint.sh + perform_lint + + clang_tidy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install clang-tidy + run: | + sudo apt-get install clang-tidy-9 -qyy + source ./util/ci/common.sh + install_linux_deps + + - name: Run clang-tidy + run: | + ./util/ci/clang-tidy.sh diff --git a/.github/workflows/lua_lint.yml b/.github/workflows/lua_lint.yml new file mode 100644 index 000000000..1b2c01192 --- /dev/null +++ b/.github/workflows/lua_lint.yml @@ -0,0 +1,32 @@ +name: lua_lint + +# Lint on lua changes on builtin or if workflow changed +on: + push: + paths: + - 'builtin/**.lua' + - '.github/workflows/**.yml' + pull_request: + paths: + - 'builtin/**.lua' + - '.github/workflows/**.yml' + +jobs: + luacheck: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install luarocks + run: | + sudo apt-get update -qyy + sudo apt-get install luarocks -qyy + + - name: Install luarocks tools + run: | + luarocks install --local luacheck + luarocks install --local busted + + - name: Run checks + run: | + $HOME/.luarocks/bin/luacheck builtin + $HOME/.luarocks/bin/busted builtin diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3d634261..d03b7b601 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -219,7 +219,6 @@ build:fedora-24: - apt-get update -y - apt-get install -y wget xz-utils unzip git cmake gettext - wget -q http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz - - sed -e "s|%PREFIX%|${WIN_ARCH}-w64-mingw32|" -e "s|%ROOTPATH%|/usr/${WIN_ARCH}-w64-mingw32|" < util/travis/toolchain_mingw.cmake.in > ${TOOLCHAIN_OUTPUT} - tar -xaf mingw.tar.xz -C /usr .build_win_template: @@ -256,7 +255,6 @@ build:win32: variables: NO_PACKAGE: "1" WIN_ARCH: "i686" - TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake" package:win32: extends: .package_win_template @@ -265,7 +263,6 @@ package:win32: variables: NO_PACKAGE: "1" WIN_ARCH: "i686" - TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake" build:win64: extends: .build_win_template @@ -274,7 +271,6 @@ build:win64: variables: NO_PACKAGE: "1" WIN_ARCH: "x86_64" - TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake" package:win64: extends: .package_win_template @@ -283,7 +279,6 @@ package:win64: variables: NO_PACKAGE: "1" WIN_ARCH: "x86_64" - TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake" package:docker: stage: package diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7b224b549..000000000 --- a/.travis.yml +++ /dev/null @@ -1,98 +0,0 @@ -language: cpp -before_install: ./util/travis/before_install.sh -script: ./util/travis/script.sh -os: linux -dist: bionic -group: edge -notifications: - email: false -matrix: - fast_finish: true - include: - - - env: CLANG_FORMAT=clang-format-8 - compiler: clang - os: linux - addons: - apt: - packages: ['clang-format-8'] - - - name: "Builtin Luacheck and Unit Tests" - language: generic - compiler: null - os: linux - addons: - apt: - packages: - - luarocks - before_install: - - luarocks install --local luacheck - - luarocks install --local busted - script: - - $HOME/.luarocks/bin/luacheck builtin - - $HOME/.luarocks/bin/busted builtin - - - env: CLANG_TIDY=clang-tidy-8 - compiler: clang - os: linux - script: ./util/travis/clangtidy.sh - addons: - apt: - packages: ['clang-tidy-8'] - - - name: "MinGW cross-compiler (32-bit)" - env: PLATFORM=Win32 - compiler: gcc - os: linux - - - name: "MinGW cross-compiler (64-bit)" - env: PLATFORM=Win64 - compiler: gcc - os: linux - -# - env: PLATFORM=Unix -# compiler: clang -# os: osx -# osx_image: xcode8 - - - env: PLATFORM=Unix COMPILER=gcc-6 - compiler: gcc - os: linux - addons: - apt: - packages: ['gcc-6', 'g++-6'] - - - env: PLATFORM=Unix COMPILER=gcc-8 - compiler: gcc - os: linux - addons: - apt: - packages: ['gcc-8', 'g++-8'] - - - env: PLATFORM=Unix COMPILER=clang-3.9 - compiler: clang - os: linux - addons: - apt: - packages: ['clang-3.9'] - - - env: PLATFORM=Unix COMPILER=clang-9 - compiler: clang - os: linux - addons: - apt: - packages: ['clang-9'] - - - env: PLATFORM=Unix COMPILER=clang-9 FREETYPE=0 - compiler: clang - os: linux - addons: - apt: - packages: ['clang-9'] - - - env: PLATFORM=Unix COMPILER=clang-9 VALGRIND=1 - compiler: clang - os: linux - addons: - apt: - packages: ['valgrind', 'clang-9'] @@ -1,7 +1,7 @@ Minetest ======== -[![Build Status](https://travis-ci.org/minetest/minetest.svg?branch=master)](https://travis-ci.org/minetest/minetest) +![Build Status](https://github.com/minetest/minetest/workflows/validate/badge.svg) [![Translation status](https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg)](https://hosted.weblate.org/engage/minetest/?utm_source=widget) [![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) 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) - |