From 5a1e58bbdfd2e6188962a65c61106ee86741ebbb Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 27 Jul 2019 18:58:55 +0200 Subject: [PATCH] rework CI scripts, integrate conan auto upload --- .travis.yml | 219 +++++++++++++++------------------------------ .travis/install.sh | 25 ++++++ .travis/run.sh | 13 +++ appveyor.yml | 29 ++++++ build.py | 9 ++ 5 files changed, 149 insertions(+), 146 deletions(-) create mode 100644 .travis/install.sh create mode 100644 .travis/run.sh create mode 100644 appveyor.yml create mode 100644 build.py diff --git a/.travis.yml b/.travis.yml index f47f7f8..6cd96be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,162 +1,89 @@ -os: linux # Use linux unless specified otherwise. -dist: xenial -sudo: required +env: + global: + - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + - CONAN_BUILD_POLICY: "missing" + - CONAN_USERNAME: "steakhal" + - CONAN_DOCKER_32_IMAGES: 1 + - CONAN_CHANNEL: "testing" + #- CONAN_UPLOAD_DEPENDENCIES="all" + - CONAN_STABLE_BRANCH_PATTERN: "release/*" + - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 -language: cpp +linux: &linux + os: linux + dist: xenial + sudo: required + language: python + python: "3.6" + services: + - docker -git: - depth: 1 +osx: &osx + os: osx + language: generic matrix: - include: - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - CXX_COMPILER=g++-7 CC_COMPILER=gcc-7 + include: + - <<: *linux + env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-8 - env: - - CXX_COMPILER=g++-8 CC_COMPILER=gcc-8 + - <<: *linux + env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - env: - - CXX_COMPILER=g++-9 CC_COMPILER=gcc-9 + - <<: *linux + env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-5.0 - packages: - - clang-5.0 - env: - - CXX_COMPILER=clang++-5.0 CC_COMPILER=clang-5.0 + - <<: *linux + env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-6.0 - packages: - - clang-6.0 - env: - - CXX_COMPILER=clang++-6.0 CC_COMPILER=clang-6.0 + - <<: *linux + env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-7 - packages: - - clang-7 - env: - - CXX_COMPILER=clang++-7 CC_COMPILER=clang-7 + - <<: *linux + env: CONAN_GCC_VERSIONS=9 CONAN_DOCKER_IMAGE=conanio/gcc9 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-8 - packages: - - clang-8 - env: - - CXX_COMPILER=clang++-8 CC_COMPILER=clang-8 + - <<: *linux + env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 - - os: osx - compiler: clang++ - osx_image: xcode9.4 - env: - - CXX_COMPILER=clang++ CC_COMPILER=clang + - <<: *linux + env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 - - os: osx - compiler: clang++ - osx_image: xcode10.2 - env: - - CXX_COMPILER=clang++ CC_COMPILER=clang + - <<: *linux + env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=7.0 CONAN_DOCKER_IMAGE=conanio/clang7 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8 + + - <<: *osx + osx_image: xcode7.3 + env: CONAN_APPLE_CLANG_VERSIONS=7.3 + + - <<: *osx + osx_image: xcode8.3 + env: CONAN_APPLE_CLANG_VERSIONS=8.1 + + - <<: *osx + osx_image: xcode9.2 + env: CONAN_APPLE_CLANG_VERSIONS=9.0 + + - <<: *osx + osx_image: xcode9.4 + env: CONAN_APPLE_CLANG_VERSIONS=9.1 + + - <<: *osx + osx_image: xcode10.1 + env: CONAN_APPLE_CLANG_VERSIONS=10.0 install: - - export CC=${CC_COMPILER} - - export CXX=${CXX_COMPILER} - - JOBS=2 # Travis machines have 2 cores. - - | - # getting Catch2 library - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - git checkout v2.9.1 - mkdir build - cd build - pwd - cmake -DCATCH_BUILD_TESTING=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF -DCMAKE_INSTALL_PREFIX=../installed .. - cmake --build . --target install --config Release - cd ../.. - - # If linux and clang install the right version of libc++. - if [[ "${TRAVIS_OS_NAME}" == "linux" && "${CXX%%+*}" == "clang" && -n "$(ls -A ${LLVM_INSTALL})" ]]; then - LLVM_INSTALL=${DEPS_DIR}/llvm/install - if [[ "${CXX}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"; - elif [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2"; - elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1"; - elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1"; - elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1"; - elif [[ "${CXX}" == "clang++-4.0" ]]; then LLVM_VERSION="4.0.1"; - elif [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.2"; - elif [[ "${CXX}" == "clang++-6.0" ]]; then LLVM_VERSION="6.0.1"; - elif [[ "${CXX}" == "clang++-7" ]]; then LLVM_VERSION="7.0.1"; - elif [[ "${CXX}" == "clang++-8" ]]; then LLVM_VERSION="8.0.0"; - fi - LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz" - LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz" - LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz" - mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi - travis_retry wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm - travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx - travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi - (cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL}) - (cd llvm/build/projects/libcxx && sudo make install -j${JOBS}) - (cd llvm/build/projects/libcxxabi && sudo make install -j${JOBS}) - export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1" - export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi" - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib" - fi - -before_script: - - rm -rf build - - mkdir -p build - - cd build - - pwd - - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=../Catch2/installed .. + - chmod +x .travis/install.sh + - ./.travis/install.sh script: - - cmake --build . -- -j${JOBS} - - ctest --output-on-failure -j${JOBS} - -notifications: - email: false + - chmod +x .travis/run.sh + - ./.travis/run.sh diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100644 index 0000000..9da0265 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + brew update || brew update + brew outdated pyenv || brew upgrade pyenv + brew install pyenv-virtualenv + brew install cmake || true + + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + + pyenv install 2.7.10 + pyenv virtualenv 2.7.10 conan + pyenv rehash + pyenv activate conan +fi + +pip install conan --upgrade +pip install conan_package_tools + +conan user diff --git a/.travis/run.sh b/.travis/run.sh new file mode 100644 index 0000000..0a3488e --- /dev/null +++ b/.travis/run.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + pyenv activate conan +fi + +python build.py diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..f1c3dfd --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +build: false + +environment: + PYTHON: "C:\\Python37" + + matrix: + - MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix' + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Debug + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Debug + + +install: + - set PATH=%PATH%;%PYTHON%/Scripts/ + - pip.exe install conan --upgrade + - pip.exe install conan_package_tools + - conan user # It creates the conan data directory + +test_script: + - python build.py diff --git a/build.py b/build.py new file mode 100644 index 0000000..b27cf1e --- /dev/null +++ b/build.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from cpt.packager import ConanMultiPackager + +if __name__ == "__main__": + builder = ConanMultiPackager() + builder.add_common_builds() + builder.run()