-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
192 lines (168 loc) · 4.74 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
language: cpp
jobs:
include:
- os: linux
dist: bionic
env: GCC_VERSION=5
- os: linux
dist: bionic
env: GCC_VERSION=6
- os: linux
dist: bionic
env: GCC_VERSION=7
- os: linux
dist: bionic
env: GCC_VERSION=8
- os: linux
dist: bionic
env: GCC_VERSION=9
- os: linux
dist: bionic
env: GCC_VERSION=10
- os: linux
dist: bionic
env: GCC_VERSION=11
- os: linux
dist: bionic
env: CLANG_VERSION=5.0
- os: linux
dist: bionic
env: CLANG_VERSION=6.0
- os: linux
dist: bionic
env: CLANG_VERSION=7
- os: linux
dist: bionic
env: CLANG_VERSION=8
- os: linux
dist: bionic
env: CLANG_VERSION=9
- os: linux
dist: bionic
env: CLANG_VERSION=10
- os: linux
dist: bionic
env: CLANG_VERSION=11
- os: linux
dist: bionic
env: CLANG_VERSION=12
- os: linux
dist: bionic
env: CLANG_VERSION=13
# osx image list https://docs.travis-ci.com/user/reference/osx/#macos-version
- os: osx
osx_image: xcode9.4
- os: osx
osx_image: xcode10.3
- os: osx
osx_image: xcode11.6
- os: osx
osx_image: xcode12.5
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=5
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=6
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=7
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=8
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=9
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=10
# - os: osx
# osx_image: xcode12.5
# env: GCC_VERSION=11
- os: freebsd
# https://www.freshports.org/
# - os: freebsd
# env: GCC_VERSION=8
# - os: freebsd
# env: GCC_VERSION=10
# - os: freebsd
# env: GCC_VERSION=11
# - os: freebsd
# env: CLANG_VERSION=70
# - os: freebsd
# env: CLANG_VERSION=80
# - os: freebsd
# env: CLANG_VERSION=90
# - os: freebsd
# env: CLANG_VERSION=10
# - os: freebsd
# env: CLANG_VERSION=11
# - os: freebsd
# env: CLANG_VERSION=12
# - os: freebsd
# env: CLANG_VERSION=13
ubuntu_prepare: &ubuntu_prepare
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.15/cmake-3.15.7-Linux-x86_64.sh"
wget -qO /tmp/cmake.sh $CMAKE_URL
sh /tmp/cmake.sh --prefix=/tmp/ --exclude-subdir --skip-license
echo "export PATH=/tmp/bin/:/usr/local/bin:/usr/bin:$PATH" >> /tmp/knet.env
if [[ "$GCC_VERSION" != "" ]]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -q update
sudo apt-get -yq install g++-$GCC_VERSION
echo "export CC=gcc-$GCC_VERSION CXX=g++-$GCC_VERSION" >> /tmp/knet.env
fi
if [[ "$CLANG_VERSION" != "" ]]; then
curl -sSL "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
echo "deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-$CLANG_VERSION main" | sudo tee -a ${TRAVIS_ROOT}/etc/apt/sources.list >/dev/null
sudo apt-get -q update
sudo apt-get -yq install clang-$CLANG_VERSION
echo "export CC=clang-$CLANG_VERSION CXX=clang++-$CLANG_VERSION" >> /tmp/knet.env
fi
fi
osx_prepare: &osx_prepare
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$GCC_VERSION" != "" ]]; then
brew install gcc@$GCC_VERSION
echo "export CC=gcc-$GCC_VERSION CXX=g++-$GCC_VERSION" >> /tmp/knet.env
fi
fi
freebsd_prepare: &freebsd_prepare
if [[ "$TRAVIS_OS_NAME" == "freebsd" ]]; then
if [[ "$GCC_VERSION" != "" ]]; then
su -m root -c "pkg install -y gcc$GCC_VERSION"
echo "export CC=gcc$GCC_VERSION CXX=g++$GCC_VERSION" >> /tmp/knet.env
fi
if [[ "$CLANG_VERSION" != "" ]]; then
su -m root -c "pkg install -y llvm$GCC_VERSION"
echo "export CC=/usr/local/bin/clang$CLANG_VERSION CXX=/usr/local/bin/clang++$CLANG_VERSION" >> /tmp/knet.env
fi
fi
before_install:
- echo > /tmp/knet.env
- *ubuntu_prepare
- *osx_prepare
- *freebsd_prepare
before_script:
- cat /tmp/knet.env
- source /tmp/knet.env
- printenv
- ${CC} --version
- ${CXX} --version
- cmake --version
script:
# Generate project
- cmake . -B build
# Debug
- cmake --build build --clean-first --config Debug
- (cd build && ctest --output-on-failure)
# Release
- cmake --build build --clean-first --config Release
- (cd build && ctest --output-on-failure)
# MinSizeRel
- cmake --build build --clean-first --config MinSizeRel
- (cd build && ctest --output-on-failure)
# RelWithDebInfo
- cmake --build build --clean-first --config RelWithDebInfo
- (cd build && ctest --output-on-failure)