rework CI scripts, integrate conan auto upload

This commit is contained in:
Balazs Benics 2019-07-27 18:58:55 +02:00
parent f0720ba756
commit 5a1e58bbdf
5 changed files with 149 additions and 146 deletions

View file

@ -1,162 +1,89 @@
os: linux # Use linux unless specified otherwise.
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
linux: &linux
os: linux
dist: xenial
sudo: required
language: python
python: "3.6"
services:
- docker
language: cpp
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
- <<: *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++
- <<: *linux
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40
- <<: *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:
- CXX_COMPILER=clang++ CC_COMPILER=clang
env: CONAN_APPLE_CLANG_VERSIONS=9.1
- os: osx
compiler: clang++
osx_image: xcode10.2
env:
- CXX_COMPILER=clang++ CC_COMPILER=clang
- <<: *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

25
.travis/install.sh Normal file
View file

@ -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

13
.travis/run.sh Normal file
View file

@ -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

29
appveyor.yml Normal file
View file

@ -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

9
build.py Normal file
View file

@ -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()