/
.travis.yml
201 lines (173 loc) · 5.64 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Copyright (C) 2019 Qian Yu
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
language: cpp
dist: xenial
sudo: false
branches:
only:
- master
- dev
jobs:
include:
# ubuntu 16.04, clang-6.0 c++14, lint
- stage: Lint
env: VER=6.0 CMAKE_CXX_STANDARD=14 INTEGRAL_SWITCH_LINT=ON
compiler: clang
os: linux
addons: { apt: { packages: ["clang-6.0", "clang-tidy-6.0", "clang-format-6.0"] } }
# ubuntu 16.04, gcc-4.9, c++11
- env: VER=4.9 CMAKE_CXX_STANDARD=11
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-4.9, c++14
- env: VER=4.9 CMAKE_CXX_STANDARD=14
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-5, c++11
- env: VER=5 CMAKE_CXX_STANDARD=11
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-5, c++14
- env: VER=5 CMAKE_CXX_STANDARD=14
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-6, c++11
- env: VER=6 CMAKE_CXX_STANDARD=11
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-6, c++14
- env: VER=6 CMAKE_CXX_STANDARD=14
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-7, c++11
- env: VER=7 CMAKE_CXX_STANDARD=11
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-7, c++14
- env: VER=7 CMAKE_CXX_STANDARD=14
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-8, c++11
- env: VER=8 CMAKE_CXX_STANDARD=11
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-8"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-8, c++14
- env: VER=8 CMAKE_CXX_STANDARD=14
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-8"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, gcc-8, c++17
- env: VER=8 CMAKE_CXX_STANDARD=17
compiler: gcc
os: linux
addons: { apt: { packages: ["g++-8"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 16.04, clang-5.0 c++11
- env: VER=5.0 CMAKE_CXX_STANDARD=11
compiler: clang
os: linux
addons: { apt: { packages: ["clang-5.0"] } }
# ubuntu 16.04, clang-5.0 c++14
- env: VER=5.0 CMAKE_CXX_STANDARD=14
compiler: clang
os: linux
addons: { apt: { packages: ["clang-5.0"] } }
# ubuntu 16.04, clang-5.0 c++17
- env: VER=5.0 CMAKE_CXX_STANDARD=17
compiler: clang
os: linux
addons: { apt: { packages: ["clang-5.0"] } }
# ubuntu 16.04, clang-6.0 c++11
- env: VER=6.0 CMAKE_CXX_STANDARD=11
compiler: clang
os: linux
addons: { apt: { packages: ["clang-6.0"] } }
# ubuntu 16.04, clang-6.0 c++14
- env: VER=6.0 CMAKE_CXX_STANDARD=14
compiler: clang
os: linux
addons: { apt: { packages: ["clang-6.0"] } }
# OS X Sierra 10.12
- env: CMAKE_CXX_STANDARD=11
compiler: clang
os: osx
osx_image: xcode8.3
# OS X Sierra 10.12
- env: CMAKE_CXX_STANDARD=14
compiler: clang
os: osx
osx_image: xcode8.3
# OS X High Sierra 10.13
- env: CMAKE_CXX_STANDARD=11
compiler: clang
os: osx
osx_image: xcode9.4
# OS X High Sierra 10.13
- env: CMAKE_CXX_STANDARD=14
compiler: clang
os: osx
osx_image: xcode9.4
# OS X High Sierra 10.13
- env: CMAKE_CXX_STANDARD=11
compiler: clang
os: osx
osx_image: xcode10.1
# OS X High Sierra 10.13
- env: CMAKE_CXX_STANDARD=14
compiler: clang
os: osx
osx_image: xcode10.1
install:
# Upgrade CMake
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update
brew upgrade cmake
fi
- cmake --version
# Set the correct `CC` and `CXX` environment variables.
- |
if [ -n "${VER}" ]; then
export CC="${CC}-${VER}"
export CXX="${CXX}-${VER}"
fi
- ${CXX} --version
script:
- |
if [ "${INTEGRAL_SWITCH_LINT}" == "ON" ];
then
mkdir build-lint;
cd build-lint;
cmake -DCMAKE_CXX_FLAGS="-Wall -Werror -fdiagnostics-color=always" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DINTEGRAL_SWITCH_LINT=ON ..;
make lint;
cmake --build .;
else
export BUILD_DIR="build-${CC}-${VER}-${CMAKE_CXX_STANDARD}";
mkdir ${BUILD_DIR};
cd ${BUILD_DIR};
cmake -DCMAKE_CXX_FLAGS="-Wall -Werror -fdiagnostics-color=always" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} ..;
cmake --build .;
ctest --output-on-failure;
fi
notifications:
email: false