Skip to contentSkip to conversation

travis-ci refactor by Steffan Karger

PATCH New Ilya Shipitsin 1 participant 1 message Sep 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 travis-ci refactor by Steffan Karger

From: Steffan Karger <[email protected]...>

---
 .travis.yml           | 63 ++++++++++++++++++++------------------
 .travis/build-deps.sh | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 29 deletions(-)
 create mode 100755 .travis/build-deps.sh
.travis.yml +34 -29
index 6f719a1..452c48e 100644
@@ -11,43 +11,49 @@ compiler:
 env:
   global:
     - JOBS=3
-    - MBEDTLS_VERSION=2.2.1
-    - MBEDTLS_PREFIX=~/opt/mbedtls
-    - MBEDTLS_LIBS="-L$MBEDTLS_PREFIX/lib -lmbedtls -lmbedx509 -lmbedcrypto"
-    - MBEDTLS_CFLAGS="-I$MBEDTLS_PREFIX/include"
-    - OPENSSL_VERSION=1.0.1t
-    - OPENSSL_PREFIX=~/opt/openssl
-    - OPENSSL_LIB=$OPENSSL_PREFIX/lib
-    - OPENSSL_INC=$OPENSSL_PREFIX/include
-    - OPENSSL_CFLAGS="-I$OPENSSL_PREFIX/include"
-    - OPENSSL_LIBS="-L$OPENSSL_PREFIX/lib -lssl -lcrypto"
+    - PREFIX="${HOME}/opt"
+    - MBEDTLS_VERSION="2.2.1"
+    - MBEDTLS_CFLAGS="-I${PREFIX}/include"
+    - MBEDTLS_LIBS="-L${PREFIX}/lib -lmbedtls -lmbedx509 -lmbedcrypto"
+    - OPENSSL_VERSION="1.0.1t"
+    - OPENSSL_CFLAGS="-I${PREFIX}/include"
+    - OPENSSL_LIBS="-L${PREFIX}/lib -lssl -lcrypto"
+    - LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"
 
 matrix:
   include:
-    - env: CONFIG="--with-crypto-library=openssl"
+    - env: SSLLIB="openssl"
+      os: linux
       compiler: gcc
-    - env: CONFIG="--with-crypto-library=openssl"
+    - env: SSLLIB="openssl"
+      os: linux
       compiler: clang
-    - env: CONFIG="--with-crypto-library=mbedtls"
+    - env: SSLLIB="mbedtls"
+      os: linux
       compiler: gcc
-    - env: CONFIG="--with-crypto-library=mbedtls"
+    - env: SSLLIB="mbedtls"
+      os: linux
       compiler: clang
-    - env: CONFIG="--with-crypto-library=openssl --disable-crypto"
+    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto"
+      os: linux
       compiler: clang
-    - env: CONFIG="--with-crypto-library=openssl --disable-lzo"
+    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-lzo"
+      os: linux
       compiler: clang
-    - env: CONFIG="--with-crypto-library=openssl --enable-small"
+    - env: SSLLIB="openssl" EXTRA_CONFIG="--enable-small"
+      os: linux
       compiler: clang
-    - env: CONFIG="--with-crypto-library=openssl"
+    - env: SSLLIB="openssl"
       os: osx
       osx_image: xcode7.3
       compiler: clang
-    - env: CONFIG="--with-crypto-library=mbedtls"
+    - env: SSLLIB="mbedtls"
       os: osx
       osx_image: xcode7.3
       compiler: clang
   allow_failures:
-    - env: CONFIG="--with-crypto-library=openssl --disable-crypto"
+    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto"
+      os: linux
       compiler: clang
   exclude:
     - compiler: gcc
@@ -65,21 +71,20 @@ cache:
   ccache: true
   directories:
   - download-cache
+  - ${HOME}/opt
 
 before_install:
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update     ; fi
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install lzo; fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update     ; fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo; fi
 
 install:
-  - mkdir ~/bin && ln -s $(which ccache) ~/bin/$CC && export PATH=$HOME/bin:$PATH
-  - if [ ! -d download-cache ]; then mkdir download-cache; fi
-  - if [[ $CONFIG == *"--with-crypto-library=openssl"* ]]; then .travis/build-openssl-${TRAVIS_OS_NAME}.sh; fi
-  - if [[ $CONFIG == *"--with-crypto-library=mbedtls"* ]]; then .travis/build-mbedtls-${TRAVIS_OS_NAME}.sh; fi
+  - .travis/build-deps.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1)
 
 script:
   - autoreconf -vi
-  - ./configure $CONFIG || (cat config.log && exit 1)
+  - ./configure --with-crypto-library="${SSLLIB}" ${EXTRA_CONFIG} || (cat config.log && exit 1)
   - make -j$JOBS
-  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ldd src/openvpn/openvpn; fi
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then otool -L src/openvpn/openvpn; fi
+  - src/openvpn/openvpn --version || true
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ldd src/openvpn/openvpn; fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then otool -L src/openvpn/openvpn; fi
   - make check
.travis/build-deps.sh new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.5.5