]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - .travis.yml
Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
[FreeBSD/FreeBSD.git] / .travis.yml
1 language: c
2
3 git:
4   depth: 5
5
6 addons:
7   apt:
8     packages:
9     - libssl-dev
10     - libevent-dev
11     - libexpat-dev
12     - clang
13   homebrew:
14     packages:
15       - openssl
16       - libevent
17       - expat
18     update: true
19
20 jobs:
21   include:
22     - os: linux
23       name: GCC on Linux, Amd64
24       compiler: gcc
25       arch: amd64
26       env:
27         - CONFIG_OPTS="--enable-debug --disable-flto"
28     - os: linux
29       name: Clang on Linux, Amd64
30       compiler: clang
31       arch: amd64
32       env:
33         - CONFIG_OPTS="--enable-debug --disable-flto"
34     - os: osx
35       name: Clang on OS X, Amd64
36       compiler: clang
37       arch: amd64
38       env:
39         - TEST_OSX=yes
40         - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/"
41     - os: linux
42       name: Libevent, GCC on Linux, Amd64
43       compiler: gcc
44       arch: amd64
45       env:
46         - TEST_LIBEVENT=yes
47         - CONFIG_OPTS="--with-libevent"
48     - os: linux
49       name: Libevent, Clang on Linux, Amd64
50       compiler: clang
51       arch: amd64
52       env:
53         - TEST_LIBEVENT=yes
54         - CONFIG_OPTS="--with-libevent"
55     - os: osx
56       name: Libevent, Clang on OS X, Amd64
57       compiler: clang
58       arch: amd64
59       env:
60         - TEST_OSX=yes
61         - TEST_LIBEVENT=yes
62         - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/"
63     - os: linux
64       name: UBsan, GCC on Linux, Amd64
65       compiler: gcc
66       arch: amd64
67       dist: bionic
68       env:
69         - TEST_UBSAN=yes
70     - os: linux
71       name: UBsan, Clang on Linux, Amd64
72       compiler: clang
73       arch: amd64
74       dist: bionic
75       env:
76         - TEST_UBSAN=yes
77     - os: linux
78       name: Asan, GCC on Linux, Amd64
79       compiler: gcc
80       arch: amd64
81       dist: bionic
82       env:
83         - TEST_ASAN=yes
84     - os: linux
85       name: Asan, Clang on Linux, Amd64
86       compiler: clang
87       arch: amd64
88       dist: bionic
89       env:
90         - TEST_ASAN=yes
91     - os: linux
92       name: GCC on Linux, Aarch64
93       compiler: gcc
94       arch: arm64
95       dist: bionic
96       env:
97         - CONFIG_OPTS="--enable-debug --disable-flto"
98     - os: linux
99       name: Clang on Linux, Aarch64
100       compiler: clang
101       arch: arm64
102       dist: bionic
103       env:
104         - CONFIG_OPTS="--enable-debug --disable-flto"
105     - os: linux
106       name: GCC on Linux, PowerPC64
107       compiler: gcc
108       arch: ppc64le
109       dist: bionic
110       env:
111         - CONFIG_OPTS="--enable-debug --disable-flto"
112     - os: linux
113       name: Clang on Linux, PowerPC64
114       compiler: clang
115       arch: ppc64le
116       dist: bionic
117       env:
118         - CONFIG_OPTS="--enable-debug --disable-flto"
119     - os: linux
120       name: GCC on Linux, s390x
121       compiler: gcc
122       arch: s390x
123       dist: bionic
124       env:
125         - CONFIG_OPTS="--enable-debug --disable-flto"
126     - os: linux
127       name: Clang on Linux, s390x
128       compiler: clang
129       arch: s390x
130       dist: bionic
131       env:
132         - CONFIG_OPTS="--enable-debug --disable-flto"
133     - os: osx
134       osx_image: xcode10
135       name: Apple iPhone on iOS, armv7
136       compiler: clang
137       env:
138         - TEST_IOS=yes
139         - AUTOTOOLS_HOST=armv7-apple-ios
140         - OPENSSL_HOST=ios-cross
141         - IOS_SDK=iPhoneOS
142         - IOS_CPU=armv7s
143         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
144     - os: osx
145       osx_image: xcode10
146       name: Apple iPhone on iOS, arm64
147       compiler: clang
148       env:
149         - TEST_IOS=yes
150         - AUTOTOOLS_HOST=aarch64-apple-ios
151         - OPENSSL_HOST=ios64-cross
152         - IOS_SDK=iPhoneOS
153         - IOS_CPU=arm64
154         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
155     - os: osx
156       osx_image: xcode10
157       name: Apple TV on iOS, arm64
158       compiler: clang
159       env:
160         - TEST_IOS=yes
161         - AUTOTOOLS_HOST=aarch64-apple-ios
162         - OPENSSL_HOST=ios64-cross
163         - IOS_SDK=AppleTVOS
164         - IOS_CPU=arm64
165         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
166     - os: osx
167       osx_image: xcode10
168       name: Apple Watch on iOS, armv7
169       compiler: clang
170       env:
171         - TEST_IOS=yes
172         - AUTOTOOLS_HOST=armv7-apple-ios
173         - OPENSSL_HOST=ios-cross
174         - IOS_SDK=WatchOS
175         - IOS_CPU=armv7k
176         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
177     - os: osx
178       osx_image: xcode10
179       name: iPhoneSimulator on OS X, i386
180       env:
181         - TEST_IOS=yes
182         - AUTOTOOLS_HOST=i386-apple-ios
183         - OPENSSL_HOST=iphoneos-cross
184         - IOS_CPU=i386
185         - IOS_SDK=iPhoneSimulator
186         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
187     - os: osx
188       osx_image: xcode10
189       name: iPhoneSimulator on OS X, x86_64
190       env:
191         - TEST_IOS=yes
192         - AUTOTOOLS_HOST=x86_64-apple-ios
193         - OPENSSL_HOST=iphoneos-cross
194         - IOS_CPU=x86_64
195         - IOS_SDK=iPhoneSimulator
196         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
197     - os: osx
198       osx_image: xcode10
199       name: AppleTVSimulator on OS X, x86_64
200       env:
201         - TEST_IOS=yes
202         - AUTOTOOLS_HOST=x86_64-apple-ios
203         - OPENSSL_HOST=iphoneos-cross
204         - IOS_CPU=x86_64
205         - IOS_SDK=AppleTVSimulator
206         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
207     - os: osx
208       osx_image: xcode10
209       name: WatchSimulator on OS X, i386
210       env:
211         - TEST_IOS=yes
212         - AUTOTOOLS_HOST=i386-apple-ios
213         - OPENSSL_HOST=iphoneos-cross
214         - IOS_CPU=i386
215         - IOS_SDK=WatchSimulator
216         - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
217     - os: linux
218       name: Android armv7a, Linux, Amd64
219       compiler: clang
220       arch: amd64
221       dist: bionic
222       env:
223         - TEST_ANDROID=yes
224         - AUTOTOOLS_HOST=armv7a-linux-androideabi
225         - OPENSSL_HOST=android-arm
226         - ANDROID_CPU=armv7a
227         - ANDROID_API=23
228         - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU"
229         - ANDROID_SDK_ROOT="$HOME/android-sdk"
230         - ANDROID_NDK_ROOT="$HOME/android-ndk"
231     - os: linux
232       name: Android aarch64, Linux, Amd64
233       compiler: clang
234       arch: amd64
235       dist: bionic
236       env:
237         - TEST_ANDROID=yes
238         - AUTOTOOLS_HOST=aarch64-linux-android
239         - OPENSSL_HOST=android-arm64
240         - ANDROID_CPU=aarch64
241         - ANDROID_API=23
242         - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU"
243         - ANDROID_SDK_ROOT="$HOME/android-sdk"
244         - ANDROID_NDK_ROOT="$HOME/android-ndk"
245     - os: linux
246       name: Android x86, Linux, Amd64
247       compiler: clang
248       arch: amd64
249       dist: bionic
250       env:
251         - TEST_ANDROID=yes
252         - AUTOTOOLS_HOST=i686-linux-android
253         - OPENSSL_HOST=android-x86
254         - ANDROID_CPU=x86
255         - ANDROID_API=23
256         - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU"
257         - ANDROID_SDK_ROOT="$HOME/android-sdk"
258         - ANDROID_NDK_ROOT="$HOME/android-ndk"
259     - os: linux
260       name: Android x86_64, Linux, Amd64
261       compiler: clang
262       arch: amd64
263       dist: bionic
264       env:
265         - TEST_ANDROID=yes
266         - AUTOTOOLS_HOST=x86_64-linux-android
267         - OPENSSL_HOST=android-x86_64
268         - ANDROID_CPU=x86_64
269         - ANDROID_API=23
270         - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU"
271         - ANDROID_SDK_ROOT="$HOME/android-sdk"
272         - ANDROID_NDK_ROOT="$HOME/android-ndk"
273
274   allow_failures:
275     - os: linux
276       name: Android armv7a, Linux, Amd64
277     - os: linux
278       name: Android aarch64, Linux, Amd64
279     - os: linux
280       name: Android x86, Linux, Amd64
281     - os: linux
282       name: Android x86_64, Linux, Amd64
283
284 before_script:
285   - |
286     if [ "$TEST_ANDROID" = "yes" ]; then
287       ./contrib/android/install_tools.sh
288     elif [ "$TEST_IOS" = "yes" ]; then
289       ./contrib/ios/install_tools.sh
290     fi
291
292 # The Travis docs say to avoid calling exit in the script. It leads to
293 # some code duplication to avoid failures in cross-compiles. Also see
294 # https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs.
295 script:
296   - |
297     if [ "$TEST_UBSAN" = "yes" ]; then
298       export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover"
299       ./configure
300       make -j 2
301       make test
302     elif [ "$TEST_ASAN" = "yes" ]; then
303       export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address"
304       ./configure
305       make -j 2
306       make test
307     elif [ "$TEST_IOS" = "yes" ]; then
308       export AUTOTOOLS_BUILD="$(./config.guess)"
309       export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig"
310       source ./contrib/ios/setenv_ios.sh
311       ./contrib/ios/install_openssl.sh
312       ./contrib/ios/install_expat.sh
313       ./configure \
314         --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \
315         --prefix="$IOS_PREFIX" \
316         --with-ssl="$IOS_PREFIX" --disable-gost \
317         --with-libexpat="$IOS_PREFIX";
318       make -j 2
319       make install
320     elif [ "$TEST_ANDROID" = "yes" ]; then
321       export AUTOTOOLS_BUILD="$(./config.guess)"
322       export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig"
323       ./contrib/android/install_ndk.sh
324       source ./contrib/android/setenv_android.sh
325       ./contrib/android/install_openssl.sh
326       ./contrib/android/install_expat.sh
327       ./configure \
328         --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \
329         --prefix="$ANDROID_PREFIX" \
330         --with-ssl="$ANDROID_PREFIX" --disable-gost \
331         --with-libexpat="$ANDROID_PREFIX";
332       make -j 2
333       make install
334     elif [ "$TEST_OSX" = "yes" ]; then
335       ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/
336       make -j 2
337       make test
338       (cd testdata/clang-analysis.tdir; bash clang-analysis.test)
339     else
340       ./configure ${CONFIG_OPTS}
341       make -j 2
342       make test
343       (cd testdata/clang-analysis.tdir; bash clang-analysis.test)
344     fi