forked from CorsixTH/CorsixTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
88 lines (83 loc) · 3.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
dist: bionic
language: cpp
compiler: gcc
addons:
apt:
sources:
packages:
- libssl-dev
- luarocks
- doxygen
- sshpass
- libavcodec-dev
- libavformat-dev
- libavutil-dev
- libswresample-dev
- libswscale-dev
- libsdl2-dev
- libsdl2-mixer-dev
- libfreetype6-dev
- libwxgtk3.0-gtk3-dev
- clang-tidy-8
before_install:
# Bionic does not have catch2 in its repo so clone and install locally
- cd $HOME
- git clone https://github.com/catchorg/Catch2.git --depth=1
- cd Catch2
- cmake -Bbuild -H. -DBUILD_TESTING=OFF
- cd build && sudo make install
- cd ${TRAVIS_BUILD_DIR}
- 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
- mkdir $TRAVIS_BUILD_DIR/LevelEdit/bin
install:
- cd $TRAVIS_BUILD_DIR
# Create unix makefiles
- cmake -DLUA_PROGRAM_PATH=`which lua` -DENABLE_UNIT_TESTS=ON -DWITH_AUDIO=ON -DWITH_MOVIES=ON -DWITH_LUAJIT=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -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
script:
# Check if there are trailing whitespaces.
- ${TRAVIS_BUILD_DIR}/scripts/check_trailing_whitespaces.py $TRAVIS_BUILD_DIR
# Check for incorrectly encoded language files.
- ${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.
- ${TRAVIS_BUILD_DIR}/scripts/check_lua_classes.py
# Check cpp format
- cd ${TRAVIS_BUILD_DIR}
- clang-format -i CorsixTH/Src/*{.cpp,.h} AnimView/*{.cpp,.h} libs/rnc/*{.cpp,.h} CorsixTH/SrcUnshared/main.cpp
# clang-tidy check. The valist test is buggy in this environment (https://bugs.llvm.org/show_bug.cgi?id=41311)
- clang-tidy-8 -p $TRAVIS_BUILD_DIR/fresh --warnings-as-errors=\*,-clang-analyzer-valist.Uninitialized CorsixTH/Src/*{.cpp,.c} libs/rnc/*.cpp CorsixTH/SrcUnshared/main.cpp
- git diff --exit-code
# Build CorsixTH
- cd fresh
- 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
# Run CPP Tests
- cd $TRAVIS_BUILD_DIR/fresh/CorsixTH
- eval 'ctest -VV'
# 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/* [email protected]:/home/cthbuilder/docs/; fi;
env:
global:
secure: "mPtzSeDJKVeUu6KHJEbmHa91O+QK2XM0advYdr+13yr83w3C7cGFFjWgqzirsFUHVqPgdtSJIkom0DIxX7JtRoBZmt/xon+zfLq+Q4aSkJoYezWBqp2gavS8o1kSjtW7XuIuq995yjWvn7nehyoTYkKNtz/EzX5ZIVZ/iX73iyo="