From 206239a66354338731d7bfc25bf8d6e3e17164f0 Mon Sep 17 00:00:00 2001 From: Alberto Invernizzi Date: Sun, 27 Jun 2021 20:06:05 +0200 Subject: [PATCH] use before_script in travis --- .travis.yml | 8 ++++++++ ci_build.sh | 27 --------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea928bd..0373c1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -106,7 +106,15 @@ matrix: # packages: # - clang-5.0 +before_script: + - mkdir -p /tmp/cmake.root + - [[ $TRAVIS_OS_SUFFIX = 'linux' ]]; then CMAKE_PKG_SUFFIX="linux-x86_64"; else CMAKE_PKG_SUFFIX="macos10.10-universal"; fi + - wget -qO- "https://cmake.org/files/v3.20/cmake-3.20.5-$CMAKE_PKG_SUFFIX.tar.gz" | tar --strip-components=1 -xz -C /tmp/cmake.root + - [[ $TRAVIS_OS_SUFFIX = 'linux' ]]; then CMAKE_BIN_DIR="CMake.app/Contents/bin"; else CMAKE_BIN_DIR="bin"; fi + - export PATH=/tmp/cmake.root/$CMAKE_BIN_DIR:$PATH + # Build and check this project script: - eval "${MATRIX_EVAL}" + - cmake --version - ./ci_build.sh diff --git a/ci_build.sh b/ci_build.sh index 341ffd9..cb182c4 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -12,31 +12,6 @@ CPPZMQ=${PWD}/cppzmq-build # Travis machines have 2 cores JOBS=2 -cmake_install() { - local CMAKE_INSTALL_DIR=/tmp/cmake.root - local CMAKE_SUFFIX="none" - - if [ $TRAVIS_OS_NAME = "linux" ]; then - CMAKE_SUFFIX="linux-x86_64" - elif [ $TRAVIS_OS_NAME = "osx" ]; then - CMAKE_SUFFIX="macos10.10-universal" - else - echo "TRAVIS_OS_NAME $TRAVIS_OS_NAME not expected" - exit 1 - fi - - mkdir -p $CMAKE_INSTALL_DIR - wget -qO- "https://cmake.org/files/v3.20/cmake-3.20.5-$CMAKE_SUFFIX.tar.gz" \ - | tar --strip-components=1 -xz -C $CMAKE_INSTALL_DIR - - if [ $TRAVIS_OS_NAME = "linux" ]; then - export PATH=$CMAKE_INSTALL_DIR/bin:$PATH - elif [ $TRAVIS_OS_NAME = "osx" ]; then - export PATH=$CMAKE_INSTALL_DIR/CMake.app/Contents/bin:$PATH - fi - cmake --version -} - libzmq_install() { curl -L https://github.com/zeromq/libzmq/archive/v"${ZMQ_VERSION}".tar.gz \ >zeromq.tar.gz @@ -87,8 +62,6 @@ cppzmq_demo() { popd } -cmake_install - if [ "${ZMQ_VERSION}" != "" ] ; then libzmq_install ; fi cppzmq_build