-
Notifications
You must be signed in to change notification settings - Fork 80
/
.travis.yml
98 lines (89 loc) · 3.58 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
language: cpp
sudo: false
matrix:
exclude: # On OSX g++ is a symlink to clang++ by default
- os: osx
compiler: gcc
include:
# Bionic Ubuntu 18.04
- os: linux
name: "Bionic - gcc 7.4.0"
dist: bionic # We can't install packages on Bionic, not sure why. Travis ignores addons...
compiler: gcc
# Bionic Ubuntu 18.04
- os: linux
name: "Bionic - clang 7"
dist: bionic # We can't install packages on Bionic, not sure why. Travis ignores addons...
compiler: clang
# clang-6
- os: linux
name: "Xenial - clang 6"
dist: xenial
env: [USE_CC='/usr/bin/clang-6.0', USE_CXX='/usr/bin/clang++-6.0']
addons:
apt:
packages: ['clang-6.0', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
sources: ['ubuntu-toolchain-r-test', 'ubuntu-toolchain-r-test']
# clang-8
- os: linux
name: "Xenial - clang 8"
dist: xenial
env: [USE_CC='/usr/bin/clang-8', USE_CXX='/usr/bin/clang++-8']
addons:
apt:
packages: ['clang-8', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
sources: ['llvm-toolchain-xenial-8', 'ubuntu-toolchain-r-test']
# clang-9
- os: linux
name: "Xenial - clang 9"
dist: xenial
env: [USE_CC='/usr/bin/clang-9', USE_CXX='/usr/bin/clang++-9']
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages: ['clang-9', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
# gcc-8
- os: linux
name: "Xenial - gcc 8"
dist: xenial
env: [USE_CC='/usr/bin/gcc-8', USE_CXX='/usr/bin/g++-8']
addons:
apt:
packages: ['gcc-8', 'g++-8', 'cmake']
sources: ['ubuntu-toolchain-r-test']
# gcc-9
- os: linux
name: "Xenial - gcc 9"
dist: xenial
env: [USE_CC='/usr/bin/gcc-9', USE_CXX='/usr/bin/g++-9']
addons:
apt:
packages: ['gcc-9', 'g++-9', 'cmake']
sources: ['ubuntu-toolchain-r-test']
- os: osx
osx_image: xcode10.3
compiler: clang
- os: osx
osx_image: xcode11.3
compiler: clang
before_install:
# Override compilers set by Travis
- if [ ! -z "${USE_CC}" ]; then echo "Override CC=${USE_CC}"; eval "CC=${USE_CC}"; fi
- if [ ! -z "${USE_CXX}" ]; then echo "Override CXX=${USE_CXX}"; eval "CXX=${USE_CXX}"; fi
- echo ${CC} && ${CC} --version
- echo ${CXX} && ${CXX} --version
# Install catch 2 dependency
- wget https://github.com/catchorg/Catch2/archive/v2.11.1.zip
- unzip v2.11.1.zip && cd Catch2-2.11.1 && mkdir -p build/ && cd build/
- cmake -DCMAKE_BUILD_TYPE=Release .. -DCMAKE_CXX_STANDARD=14 -DCMAKE_INSTALL_PREFIX=~/.local/ && cmake --build . --target install
- cd ../..
script:
#Build & Install library
- (mkdir -p lib/build-debug/ && cd lib/build-debug && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . --target install)
- (mkdir -p lib/build-release/ && cd lib/build-release && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . --target install)
# Run tests
- (mkdir -p test/build-debug/ && cd test/build-debug && cmake ${EXTRA_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . && ctest -V .)
- (mkdir -p test/build-release/ && cd test/build-release && cmake ${EXTRA_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . && ctest -V .)