forked from electronicarts/EASTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
123 lines (110 loc) · 7.49 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
118
119
120
121
122
123
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
env:
- EASTL_CONFIG=Debug
- EASTL_CONFIG=Release
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
- libc++-dev
matrix:
include:
- compiler: clang "release build with clang to trigger MOJI check"
env: EASTL_CONFIG=Release USE_MOJI_CHECK=yes
os: linux
- compiler: clang "debug build with clang3.9"
env: EASTL_CONFIG=Debug USE_CLANG_39=yes
os: osx
- compiler: clang "release build with clang3.9"
env: EASTL_CONFIG=Release USE_CLANG_39=yes
os: osx
- compiler: clang "build with Buck"
env: USE_BUCK=yes
os: osx
exclude:
- os: osx
compiler: gcc
install:
# MOJI check; exit 1 if non-ascii characters detected in C++
- if [[ -n "$USE_MOJI_CHECK" && -n `git grep -P "[^[:ascii:]]" source test` ]]; then echo "Moji Detected" && exit 1 ;fi
- if [[ -n "$USE_MOJI_CHECK" ]]; then exit 0 ;fi
# Linux Setup
# CMake
- if [[ "$TRAVIS_OS_NAME" == "linux" && ! -n "$USE_BUCK" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && ! -n "$USE_BUCK" ]]; then tar -xzf cmake-3.1.3-Linux-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$PWD/cmake-3.1.3-Linux-x86_64/bin:$PATH ;fi
# GCC
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8" ;fi
# Linuxbrew
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -d $HOME/.linuxbrew/bin || git clone https://github.com/Linuxbrew/brew.git $HOME/.linuxbrew ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then PATH="$HOME/.linuxbrew/bin:$PATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export MANPATH="$(brew --prefix)/share/man:$MANPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export INFOPATH="$(brew --prefix)/share/info:$INFOPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then brew --version ;fi
# Linuxbrew GCC
- if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then brew install gcc ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then which gcc ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then gcc --version ;fi
# OSX Setup
# CMake
- if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Darwin-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then tar -xzf cmake-3.1.3-Darwin-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then export PATH=$PWD/cmake-3.1.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH ;fi
# Clang 3.9
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then export CLANG_URL=http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then wget --no-check-certificate $CLANG_URL ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then tar -xzf clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then export CLANG_39_PATH=$(PWD)/clang+llvm-3.9.0-x86_64-apple-darwin/ ;fi
# Homebrew
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then test -d $HOME/.homebrew/bin || git clone https://github.com/Homebrew/brew.git $HOME/.homebrew ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH="$HOME/.homebrew/bin:$PATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo 'export PATH="$HOME/.homebrew/bin:$PATH"' >>~/.bash_profile ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export MANPATH="$(brew --prefix)/share/man:$MANPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export INFOPATH="$(brew --prefix)/share/info:$INFOPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew --version ;fi
# Universal Setup
# Buck
- if [[ -n "$USE_BUCK" ]]; then brew install ant ;fi
- if [[ -n "$USE_BUCK" ]]; then brew tap facebook/fb ;fi
- if [[ -n "$USE_BUCK" ]]; then brew install buck ;fi
- if [[ -n "$USE_BUCK" ]]; then buck --version ;fi
before_script:
- if [[ "$CXX" == "clang++" ]]; then export CXXFLAGS="$CXXFLAGS -I${LLVM_ROOT}/install/include -std=c++14 -stdlib=libc++" ;fi
- if [[ "$CXX" == "clang++" ]]; then export LDFLAGS="$LDFLAGS -L${LLVM_ROOT}/install/lib" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export PATH="${CLANG_39_PATH}/bin:$PATH" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CC="clang" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CXX="clang++" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CXXFLAGS="$CXXFLAGS -I${CLANG_39_PATH}/include -std=c++14 -stdlib=libc++" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export LDFLAGS="$LDFLAGS -L${CLANG_39_PATH}/lib" ;fi
- if [[ ! -n "$USE_BUCK" ]]; then mkdir build_$EASTL_CONFIG ;fi
- if [[ ! -n "$USE_BUCK" ]]; then cd build_$EASTL_CONFIG ;fi
- if [[ ! -n "$USE_BUCK" ]]; then cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON ;fi
- if [[ ! -n "$USE_BUCK" ]]; then cmake --build . --config $EASTL_CONFIG ;fi
script:
# Run the Buck build and tests
- if [[ -n "$USE_BUCK" ]]; then buck build :eastl ;fi
- if [[ -n "$USE_BUCK" ]]; then buck run :test-runner ;fi
# Run Tests
- if [[ ! -n "$USE_BUCK" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test ;fi
- if [[ ! -n "$USE_BUCK" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi
# Run Benchmarks
- if [[ ! -n "$USE_BUCK" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark ;fi
- if [[ ! -n "$USE_BUCK" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi
branches:
except:
- gh-pages
cache:
directories:
- $HOME/.linuxbrew/
- $HOME/.homebrew/