Travis: When testing installation, build in separate dir, otherwise in checkout
[openssl.git] / .travis.yml
1 language: c
2 cache: ccache
3
4 addons:
5     apt:
6         packages:
7             - ccache
8             - clang-3.6
9             - gcc-5
10             - binutils-mingw-w64
11             - gcc-mingw-w64
12             - wine
13         sources:
14             - llvm-toolchain-precise-3.6
15             - ubuntu-toolchain-r-test
16
17 os:
18     - linux
19     - osx
20
21 compiler:
22     - clang
23     - gcc
24
25 env:
26     - CONFIG_OPTS="" DESTDIR="_install"
27     - CONFIG_OPTS="--debug no-shared enable-crypto-mdebug enable-rc5 enable-md2"
28     - CONFIG_OPTS="--strict-warnings no-shared" BUILDONLY="yes"
29     - CONFIG_OPTS="no-pic --strict-warnings" BUILDONLY="yes"
30     - CONFIG_OPTS="no-engine no-shared --strict-warnings" BUILDONLY="yes"
31
32 matrix:
33     include:
34         - os: linux
35           compiler: clang-3.6
36           env: CONFIG_OPTS="no-shared enable-asan"
37         - os: linux
38           compiler: clang-3.6
39           env: CONFIG_OPTS="no-shared enable-msan"
40         - os: linux
41           compiler: clang-3.6
42           env: CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method -fno-sanitize=alignment"
43         - os: linux
44           compiler: clang-3.6
45           env: CONFIG_OPTS="no-shared no-asm enable-asan enable-rc5 enable-md2"
46         - os: linux
47           compiler: gcc-5
48           env: CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 -DPEDANTIC"
49         - os: linux
50           compiler: i686-w64-mingw32-gcc
51           env: CONFIG_OPTS="no-pic"
52         - os: linux
53           compiler: x86_64-w64-mingw32-gcc
54           env: CONFIG_OPTS="no-pic"
55     exclude:
56         - os: linux
57           compiler: clang
58         - os: osx
59           compiler: gcc
60
61 before_script:
62     - if [ -n "$DESTDIR" ]; then
63           sh .travis-create-release.sh $TRAVIS_OS_NAME;
64           tar -xvzf _srcdist.tar.gz;
65           mkdir _build;
66           cd _build;
67           srcdir=../_srcdist;
68           top=..;
69       else
70           srcdir=.;
71           top=.;
72       fi
73     - if [ "$CC" == i686-w64-mingw32-gcc ]; then
74           export CROSS_COMPILE=${CC%%gcc}; unset CC;
75           $srcdir/Configure mingw $CONFIG_OPTS -Wno-pedantic-ms-format;
76       elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
77           export CROSS_COMPILE=${CC%%gcc}; unset CC;
78           $srcdir/Configure mingw64 $CONFIG_OPTS -Wno-pedantic-ms-format;
79       else
80           if which ccache >/dev/null && [ "$CC" != clang-3.6 ]; then
81               CC="ccache $CC";
82           fi;
83           $srcdir/config $CONFIG_OPTS;
84       fi
85     - cd $top
86
87 script:
88     - if [ -n "$DESTDIR" ]; then
89           cd _build;
90           top=..;
91       else
92           top=.;
93       fi
94     - make update
95     - make
96     - if [ -z "$BUILDONLY" ]; then
97           if [ -n "$CROSS_COMPILE" ]; then
98               export EXE_SHELL="wine" WINEPREFIX=`pwd`;
99           fi;
100           HARNESS_VERBOSE=yes make test;
101       else
102           make build_tests;
103       fi
104     - if [ -n "$DESTDIR" ]; then
105           mkdir "../$DESTDIR";
106           make install install_docs DESTDIR="../$DESTDIR";
107       fi
108     - cd $top
109
110 notifications:
111     email:
112         - openssl-commits@openssl.org
113