Permalink
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (67 sloc) 2.94 KB
sudo: false
dist: trusty
language: cpp
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libssl-dev
- luarocks
- doxygen
- g++-5
- sshpass
before_install:
- luarocks --local install --server=http://luarocks.org luasec OPENSSL_DIR=/usr OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu/
# Required for LDocGen
- luarocks --local install lpeg
- luarocks --local install luafilesystem
- luarocks --local install luasocket
- luarocks --local install luacheck 0.19.1
# Required for lua unit tests
- luarocks --local install busted
- git clone --depth=1 https://github.com/CorsixTH/deps.git $HOME/deps
- mkdir libs
- pushd libs
- mkdir $TRAVIS_BUILD_DIR/LevelEdit/bin
- popd
install:
- CMAKE_INCLUDE_PATH=$HOME/deps/gnu-linux-x64
- CMAKE_LIBRARY_PATH=$HOME/deps/gnu-linux-x64/lib
- cd $TRAVIS_BUILD_DIR
# Create unix makefiles
- cp $HOME/deps/travisci/cmake/FindFreetype.cmake CMake/FindFreetype.cmake
- cmake -DCMAKE_CXX_COMPILER="g++-5" -DLUA_PROGRAM_PATH=`which lua` -DWITH_AUDIO=ON -DWITH_MOVIES=ON -DWITH_LUAJIT=OFF -DCMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH;$CMAKE_INCLUDE_PATH/SDL2" -DCMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH" -DLUA_LIBRARY="$CMAKE_LIBRARY_PATH/liblua.so" -Bfresh -H. --debug-output
before_script:
# Don't ask for confirmation when using scp
- echo -e "Host armedpineapple.co.uk\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "Host server2.armedpineapple.co.uk\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- cd fresh
script:
# Check if there are trailing whitespaces.
- ${TRAVIS_BUILD_DIR}/scripts/check_trailing_whitespaces.py $TRAVIS_BUILD_DIR
# Check for incorrectly encoded language files.
- python ${TRAVIS_BUILD_DIR}/scripts/check_language_files_not_BOM.py $TRAVIS_BUILD_DIR/CorsixTH/Lua/languages
# Check if there are lua classes with invalid/improper declarations.
- python ${TRAVIS_BUILD_DIR}/scripts/check_lua_classes.py
# Build CorsixTH
- make VERBOSE=1
# Validate lua files
- find $TRAVIS_BUILD_DIR -path $TRAVIS_BUILD_DIR/CorsixTH/Lua/languages -prune -o -name '*.lua' -print0 | xargs -0 luac -p --
- cd $TRAVIS_BUILD_DIR
- /home/travis/.luarocks/bin/luacheck -q .
# Run lua unit tests
- cd $TRAVIS_BUILD_DIR/CorsixTH/Luatest
- eval `luarocks --local path`
- LUA_PATH="../Lua/?.lua;$LUA_PATH" /home/travis/.luarocks/bin/busted
# Build LevelEdit
- cd $TRAVIS_BUILD_DIR/LevelEdit && ant dist
# Build documentation
- cd ${TRAVIS_BUILD_DIR}/fresh && make doc
after_success:
# Upload new docs
- if [ $TRAVIS_REPO_SLUG == "CorsixTH/CorsixTH" -a $TRAVIS_BRANCH == "master" ]; then sshpass -p "$SCP_PASS" scp -r -v -P12349 $TRAVIS_BUILD_DIR/fresh/doc/* cthbuilder@server2.armedpineapple.co.uk:/home/cthbuilder/docs/; fi;
env:
global:
secure: "mPtzSeDJKVeUu6KHJEbmHa91O+QK2XM0advYdr+13yr83w3C7cGFFjWgqzirsFUHVqPgdtSJIkom0DIxX7JtRoBZmt/xon+zfLq+Q4aSkJoYezWBqp2gavS8o1kSjtW7XuIuq995yjWvn7nehyoTYkKNtz/EzX5ZIVZ/iX73iyo="