This repository has been archived by the owner on Dec 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
.travis.yml
135 lines (120 loc) · 4.81 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
124
125
126
127
128
129
130
131
132
133
134
135
# Ubuntu 14.04 Trusty support
dist: trusty
sudo: required
# Enable C++ support
language: cpp
# The branch to build
branches:
only:
- master
env:
# Workaround for https://github.com/travis-ci/travis-ci/issues/4681
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include:
####################################################################
# Build with the main configuration on all the supported compilers #
####################################################################
# Clang 5.0
- os: linux
compiler: clang++-5.0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- libxi-dev
- libxcursor-dev
- libxinerama-dev
- libxrandr-dev
- libgl1-mesa-dev
- mesa-common-dev
- clang-5.0
- xvfb
env: CC_VERSION=clang-5.0 CXX_VERSION=clang++-5.0
# OSX
# - Xcode 10.2.1 (build version 10E1001)
- os: osx
osx_image: xcode10.2
env: OSX="On" CC_VERSION=clang CXX_VERSION=clang++
# - Xcode 12.0 (build version 12A8161k)
- os: osx
osx_image: xcode12u
env: OSX="On" CC_VERSION=clang CXX_VERSION=clang++
install:
###################################################################
# All the dependencies are installed in ${HOME}/deps/ #
###################################################################
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
###################################################################
# Setup default versions and override CXX set by Travis if needed #
###################################################################
- if [[ "${CC_VERSION}" != "" ]]; then export CC=${CC_VERSION}; fi
- if [[ "${CXX_VERSION}" != "" ]]; then export CXX=${CXX_VERSION}; fi
- ${CXX} --version
##########################
# Install a recent CMake #
##########################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.18/cmake-3.18.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
- cmake --version
############################################################################
# Install libc++ and libc++abi if needed
############################################################################
- |
if [[ "${CXX%%+*}" == "clang" && "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.1";
elif [[ "${CXX}" == "clang++-6.0" ]]; then LLVM_VERSION="6.0.1";
fi
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
travis_retry wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm || exit 1
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx || exit 1
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi || exit 1
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install) || exit 1
(cd llvm/build/projects/libcxx && make install -j2) || exit 1
(cd llvm/build/projects/libcxxabi && make install -j2) || exit 1
export CXXFLAGS="-isystem ${DEPS_DIR}/llvm/install/include/c++/v1"
export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
fi
before_script:
####################################################################
# Go back to the root of the project and setup the build directory #
####################################################################
- cd "${TRAVIS_BUILD_DIR}"
- cmake --version
- mkdir build && cd build && cmake ../
# -
# - Setup virtual X server in order to run the examples:
# - See https://docs.travis-ci.com/user/gui-and-headless-browsers/#using-xvfb-to-run-tests-that-require-a-gui
- |
if [[ $TRAVIS_OS_NAME = 'linux' ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3
fi
# Build steps
script:
- make all -j 4 -k
- ctest . --output-on-failure
# -
# - BabylonStudio -a will run all the example and take screenshot (this is disabled for now)
# - cd build/bin
# - ./BabylonStudio -a
# Notifications settings
notifications:
email:
on_success: never
on_failure: always