GSL/.travis.yml
2020-01-16 17:55:56 +01:00

370 lines
12 KiB
YAML

# Based on https://github.com/ldionne/hana/blob/master/.travis.yml
language: cpp
sudo: false
notifications:
email: false
# Use Linux unless specified otherwise
os: linux
dist: trusty
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps
matrix:
include:
##########################################################################
# AppleClang on OSX
##########################################################################
# XCode 8.3
- name: AppleClang Xcode-8.3 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode8.3
- name: AppleClang Xcode-8.3 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode8.3
# XCode 9.0 earliest C++17 support
- name: AppleClang Xcode-9.0 C++17 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17
os: osx
osx_image: xcode9 # AppleClang 9.1.0 same compiler in Xcode 9.0, 9.1 and 9.2
- name: AppleClang Xcode-9.0 C++17 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=17
os: osx
osx_image: xcode9
- name: AppleClang Xcode-9.0 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode9
- name: AppleClang Xcode-9.0 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode9
# XCode 9.4
- name: AppleClang Xcode-9.4 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode9.4 # AppleClang 9.1.0 same compiler as Xcode 9.3
- name: AppleClang Xcode-9.4 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode9.4
- name: AppleClang Xcode-9.4 C++17 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17
os: osx
osx_image: xcode9.4
- name: AppleClang Xcode-9.4 C++17 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=17
os: osx
osx_image: xcode9.4
# XCode 10.1
- name: AppleClang Xcode-10.1 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode10.1 # AppleClang 10.0.0 same compiler as Xcode 10.0
- name: AppleClang Xcode-10.1 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode10.1
- name: AppleClang Xcode-10.1 C++17 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17
os: osx
osx_image: xcode10.1
- name: AppleClang Xcode-10.1 C++17 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=17
os: osx
osx_image: xcode10.1
# XCode 10.3
- name: AppleClang Xcode-10.3 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode10.3 # AppleClang 10.0.1 same compiler as Xcode 10.2
- name: AppleClang Xcode-10.3 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode10.3
- name: AppleClang Xcode-10.3 C++17 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17
os: osx
osx_image: xcode10.3
- name: AppleClang Xcode-10.3 C++17 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=17
os: osx
osx_image: xcode10.3
# XCode 11.3
- name: AppleClang Xcode-11.3 C++17 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17
os: osx
osx_image: xcode11.3 # AppleClang 11.0.0 linker update / same as Xcode 11.2
- name: AppleClang Xcode-11.3 C++17 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=17
os: osx
osx_image: xcode11.3
- name: AppleClang Xcode-11.3 C++14 Debug
env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14
os: osx
osx_image: xcode11.3
- name: AppleClang Xcode-11.3 C++14 Release
env: BUILD_TYPE=Release GSL_CXX_STANDARD=14
os: osx
osx_image: xcode11.3
##########################################################################
# Clang on Linux
##########################################################################
# Clang 3.6
- env: CXX=clang++-3.6 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang36
apt:
packages:
- clang-3.6
- g++-5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- env: CXX=clang++-3.6 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang36
# Clang 3.7
- env: CXX=clang++-3.7 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang37
apt:
packages:
- clang-3.7
- g++-5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- env: CXX=clang++-3.7 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang37
# Clang 3.8
- env: CXX=clang++-3.8 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang38
apt:
packages:
- clang-3.8
- g++-5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- env: CXX=clang++-3.8 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang38
# Clang 3.9
- env: CXX=clang++-3.9 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang39
apt:
packages:
- clang-3.9
- g++-5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- env: CXX=clang++-3.9 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang39
# Clang 4.0
- env: CXX=clang++-4.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang40
apt:
packages:
- clang-4.0
- g++-5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- env: CXX=clang++-4.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang40
# Clang 5.0
- env: CXX=clang++-5.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang50
apt:
packages:
- clang-5.0
- g++-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- env: CXX=clang++-5.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang50
- env: CXX=clang++-5.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
addons: *clang50
- env: CXX=clang++-5.0 BUILD_TYPE=Release GSL_CXX_STANDARD=17
addons: *clang50
# Clang 6.0
- env: CXX=clang++-6.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang60
apt:
packages:
- clang-6.0
- g++-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- env: CXX=clang++-6.0 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang60
# Clang 6.0 c++17
- env: CXX=clang++-6.0 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
addons: *clang60
- env: CXX=clang++-6.0 BUILD_TYPE=Release GSL_CXX_STANDARD=17
addons: *clang60
# Clang 7.0
- env: CXX=clang++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &clang70
apt:
packages:
- clang-7
- g++-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- env: CXX=clang++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *clang70
# Clang 7.0 c++17
- env: CXX=clang++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
addons: *clang70
- env: CXX=clang++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=17
addons: *clang70
##########################################################################
# GCC on Linux
##########################################################################
# GCC 5
- env: CXX=g++-5 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &gcc5
apt:
packages: g++-5
sources:
- ubuntu-toolchain-r-test
- env: CXX=g++-5 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *gcc5
# GCC 6
- env: CXX=g++-6 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &gcc6
apt:
packages: g++-6
sources:
- ubuntu-toolchain-r-test
- env: CXX=g++-6 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *gcc6
# GCC 7
- env: CXX=g++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=14
addons: &gcc7
apt:
packages: g++-7
sources:
- ubuntu-toolchain-r-test
- env: CXX=g++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=14
addons: *gcc7
# GCC 7 c++17
- env: CXX=g++-7 BUILD_TYPE=Debug GSL_CXX_STANDARD=17
addons: *gcc7
- env: CXX=g++-7 BUILD_TYPE=Release GSL_CXX_STANDARD=17
addons: *gcc7
install:
- ${CXX} --version
# Dependencies required by the CI are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p "${DEPS_DIR}"
- cd "${DEPS_DIR}"
# Travis machines have 2 cores
- JOBS=2
############################################################################
# Install a recent CMake (unless already installed on OS X)
############################################################################
- CMAKE_VERSION=3.7.2
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake || brew upgrade cmake
fi
- cmake --version
############################################################################
# [linux]: Install the right version of libc++
############################################################################
- |
LLVM_INSTALL=${DEPS_DIR}/llvm/install
# if in linux and compiler clang and llvm not installed
if [[ "${TRAVIS_OS_NAME}" == "linux" && "${CXX%%+*}" == "clang" && -n "$(ls -A ${LLVM_INSTALL})" ]]; then
if [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1";
elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1";
elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.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
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL})
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1"
export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib"
fi
before_script:
# have CMake to generate build files
- cd "${TRAVIS_BUILD_DIR}"
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DGSL_CXX_STANDARD=$GSL_CXX_STANDARD
script:
# build and run tests
- cmake --build . -- -j${JOBS}
- ctest --output-on-failure -j${JOBS}