forked from mikke89/RmlUi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
117 lines (110 loc) · 3.83 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
sudo: false
dist: bionic
language: c++
cache:
apt: true
directories:
- $HOME/.deps
matrix:
include:
- os: osx
osx_image: xcode10.3
compiler: clang
- os: linux
compiler: clang
env: BUILD_TESTING="ON"
addons:
apt:
packages:
- cmake
- ninja-build
- libsdl2-dev
- libsdl2-image-dev
- libfreetype6-dev
- libglew-dev
- liblua5.2-dev
- libsfml-dev
- os: linux
compiler: clang
env: NO_FONT_INTERFACE_DEFAULT="ON"
addons:
apt:
packages:
- cmake
- ninja-build
- libsdl2-dev
- libsdl2-image-dev
- libfreetype6-dev
- libglew-dev
- liblua5.2-dev
- libsfml-dev
- os: linux
compiler: gcc
env: DISABLE_RTTI_AND_EXCEPTIONS="ON" NO_THIRDPARTY_CONTAINERS="ON"
addons:
apt:
packages:
- cmake
- ninja-build
- libsdl2-dev
- libsdl2-image-dev
- libfreetype6-dev
- libglew-dev
- liblua5.2-dev
- libsfml-dev
- os: linux
compiler: gcc
env: VALGRIND_SAMPLES="1"
services:
- xvfb
addons:
apt:
packages:
- cmake
- ninja-build
- libsdl2-dev
- libsdl2-image-dev
- libfreetype6-dev
- libglew-dev
- liblua5.2-dev
- libsfml-dev
- mesa-utils
- valgrind
install:
- mkdir -p $HOME/.deps
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ ! -d "$HOME/.deps/cmake" ]]; then
cd $HOME/.deps
CMAKE_URL="https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz"
mkdir -p cmake && travis_retry wget --no-clobber --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
export PATH=${HOME}/.deps/cmake/bin:${PATH}
echo ${PATH}
fi
- cmake --version
- cd "$TRAVIS_BUILD_DIR"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DNO_THIRDPARTY_CONTAINERS=ON -DENABLE_PRECOMPILED_HEADERS=OFF -G Xcode .; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then cmake -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON -DBUILD_TESTING=${BUILD_TESTING:-OFF} -DWARNINGS_AS_ERRORS=ON -DDISABLE_RTTI_AND_EXCEPTIONS=${DISABLE_RTTI_AND_EXCEPTIONS:-OFF} -DNO_THIRDPARTY_CONTAINERS=${NO_THIRDPARTY_CONTAINERS:-OFF} -DNO_FONT_INTERFACE_DEFAULT=${NO_FONT_INTERFACE_DEFAULT:-OFF} -G Ninja .; fi
before_script:
- if [[ "$VALGRIND_SAMPLES" == "1" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; fi
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project rmlui.xcodeproj/ -jobs 4 -configuration Release -scheme ALL_BUILD | xcpretty --color; test ${PIPESTATUS[0]} -eq 0; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then ninja; fi
- if [[ "$BUILD_TESTING" == "ON" ]]; then ctest; fi
- if [[ "$VALGRIND_SAMPLES" == "1" ]]; then mkdir build && DESTDIR=build ninja install; fi
- |
if [[ "$VALGRIND_SAMPLES" == "1" ]]; then
cnt=0
vout=$(mktemp)
for f in $(find $TRAVIS_BUILD_DIR/build/usr/local/opt/RmlUi/Samples/ -executable -type f); do
cd `dirname $f`
sample=$(basename $f)
printf "\033[0;36m$sample\033[0m\n"
LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/build/usr/local/lib timeout --preserve-status --signal=TERM --kill-after=15 10 valgrind --leak-check=full --track-origins=yes --suppressions=$TRAVIS_BUILD_DIR/.travis.valgrind.supp --error-exitcode=1 --log-fd=1 ./$sample >>$vout
cnt=$((cnt+1))
done;
cat $vout
okcnt=$(grep 'ERROR SUMMARY: 0 errors' $vout | wc -l)
if [[ "$okcnt" != "$cnt" ]]; then exit 1; fi
fi