forked from electronicarts/EASTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
79 lines (66 loc) · 3.9 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
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
env:
- EASTL_CONFIG=Debug BUILDER=cmake
- EASTL_CONFIG=Release BUILDER=cmake
- EASTL_CONFIG=Debug BUILDER=bazel
- EASTL_CONFIG=Release BUILDER=bazel
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
- llvm-toolchain-trusty-5.0
packages:
- cmake
- cmake-data
- g++-7
- clang-5.0
- wget
- pkg-config
matrix:
include:
- compiler: clang "release build with clang to trigger MOJI check"
env: EASTL_CONFIG=Release USE_MOJI_CHECK=yes
os: linux
exclude:
- os: osx
compiler: gcc
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/bazelbuild/bazel/releases/download/0.20.0/bazel_0.20.0-linux-x86_64.deb ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/bazelbuild/bazel/releases/download/0.20.0/bazel_0.20.0-linux-x86_64.deb.sha256 ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sha256sum -c bazel_0.20.0-linux-x86_64.deb.sha256 ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i bazel_0.20.0-linux-x86_64.deb ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget https://github.com/bazelbuild/bazel/releases/download/0.20.0/bazel-0.20.0-installer-darwin-x86_64.sh ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sh bazel-0.20.0-installer-darwin-x86_64.sh ;fi
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
- if [[ "$CXX" == "g++" ]]; then export CC="gcc-7" ;fi
- if [[ "$CXX" == "g++" ]]; then export CXX="g++-7" ;fi
# Universal Setup
before_script:
- if [[ "$BUILDER" == "cmake" ]]; then mkdir build_$EASTL_CONFIG ;fi
- if [[ "$BUILDER" == "cmake" ]]; then cd build_$EASTL_CONFIG ;fi
- if [[ "$BUILDER" == "cmake" ]]; then cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON ;fi
- if [[ "$BUILDER" == "cmake" ]]; then cmake --build . --config $EASTL_CONFIG ;fi
script:
# Run Tests
- if [[ "$BUILDER" == "cmake" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test ;fi
- if [[ "$BUILDER" == "cmake" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi
- if [[ "$BUILDER" == "bazel" && "$EASTL_CONFIG" == "Debug" ]]; then bazel run -c dbg --copt "-DEASTL_DEBUG=1" //:test-runner ;fi
- if [[ "$BUILDER" == "bazel" && "$EASTL_CONFIG" == "Release" ]]; then bazel run -c opt --copt "-DEASTL_DEBUG=0" //:test-runner ;fi
# Run Benchmarks
- if [[ "$BUILDER" == "cmake" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark ;fi
- if [[ "$BUILDER" == "cmake" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi
- if [[ "$BUILDER" == "bazel" && "$EASTL_CONFIG" == "Debug" ]]; then bazel run -c dbg --copt "-DEASTL_DEBUG=1" //:benchmark ;fi
- if [[ "$BUILDER" == "bazel" && "$EASTL_CONFIG" == "Release" ]]; then bazel run -c opt --copt "-DEASTL_DEBUG=0" //:benchmark ;fi
branches:
except:
- gh-pages