1 Star 0 Fork 0

莫名/NanoRange

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.travis.yml 6.44 KB
一键复制 编辑 原始数据 按行查看 历史
#
# Travis CI config file
#
# Copyright Tristan Brindle 2018
#
# Use, modification and distribution is subject to the
# Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Heavily based on travis.yml from Boost.Hana
#
# Copyright Louis Dionne 2013-18
#
language: cpp
os: linux
dist: xenial
# Do not build branches of the form "pr/*". By prefixing pull requests coming
# from branches inside the repository with pr/, this avoids building both the
# branch push _and_ the pull request.
# Based on https://github.com/boostorg/hana/blob/master/.travis.yml
branches:
except: /pr\/.*/
matrix:
include:
#
# Mac OS builds
#
- os: osx
osx_image: xcode11.3
env: COMPILER=clang++
- os: osx
osx_image: xcode11
env: COMPILER=clang++
- os: osx
osx_image: xcode10.2
env: COMPILER=clang++
- os: osx
osx_image: xcode10.1
env: COMPILER=clang++
#
# Linux builds
#
# GCC 9
- language: python
python: "3.7"
install:
- pip install conan-package-tools
env:
- COMPILER=g++-9
- BUILD_SINGLE_HEADER=true
- CONAN_GCC_VERSIONS=9
- CONAN_DOCKER_IMAGE=conanio/gcc9
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
# GCC 8
- env: COMPILER=g++-8
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
# GCC 7
- env: COMPILER=g++-7
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
# Clang 9
- env: COMPILER=clang++-9
addons:
apt:
packages:
- clang-9
- libc++-9-dev
- libc++abi-9-dev
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
# Clang 8
- env: COMPILER=clang++-8
addons:
apt:
packages:
- clang-8
- libc++-8-dev
- libc++abi-8-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
# Clang 7
- env: COMPILER=clang++-7
addons:
apt:
packages:
- clang-7
- libc++-7-dev
- libc++abi-7-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-7
# Clang 6
- env: COMPILER=clang++-6.0
addons:
apt:
packages:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
# Clang 5
- env: COMPILER=clang++-5.0
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-5.0
install:
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
- ${CXX} --version
############################################################################
# Install libc++ and libc++abi if needed
# Taken from https://github.com/boostorg/hana/blob/master/.travis.yml
############################################################################
- |
if [[ "$TRAVIS_OS_NAME" == "linux" && "${CXX%%+*}" == "clang" ]]; then
if [[ "${CXX}" == "clang++-5.0" || "${CXX}" == "clang++-6.0" ]]; then
if [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.2";
elif [[ "${CXX}" == "clang++-6.0" ]]; then LLVM_VERSION="6.0.0";
elif [[ "${CXX}" == "clang++-7" ]]; then LLVM_VERSION="7.0.0";
elif [[ "${CXX}" == "clang++-8" ]]; then LLVM_VERSION="8.0.0";
elif [[ "${CXX}" == "clang++-9" ]]; then LLVM_VERSION="9.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 || exit 1
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx || exit 1
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi || exit 1
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install) || exit 1
(cd llvm/build/projects/libcxx && make install -j2) || exit 1
(cd llvm/build/projects/libcxxabi && make install -j2) || exit 1
export CXXFLAGS="-isystem ${DEPS_DIR}/llvm/install/include/c++/v1"
export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
else
export CXXFLAGS="-stdlib=libc++"
fi
fi
before_script:
- cd $TRAVIS_BUILD_DIR
- mkdir -p -v build
script:
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=$COMPILER
- cmake --build . --target test_nanorange -- -j2
- ctest -j2
after_success:
- |
if [[ "${BUILD_SINGLE_HEADER}" == "true" ]]; then
if [[ "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" ]]; then
cmake --build . --target make_single_header
cd ..
./build/tools/make_single_header include/nanorange.hpp single_include/nanorange.hpp
# Suppress output to avoid leaking the token when the command fails
git clone https://tcbrindle:${GITHUB_TOKEN}@github.com/tcbrindle/nanorange --depth 1 checkout &>/dev/null
rm -rf checkout/single_include/nanorange.hpp
cp -R single_include/nanorange.hpp checkout/single_include/nanorange.hpp
pushd checkout
git config --global user.name "Travis Bot"
git config --global user.email "travis@travis-ci.org"
git add --all .
git commit --allow-empty -m "[skip ci] Update single header"
# Suppress output to avoid leaking the token
travis_retry git push origin master &>/dev/null
popd
python .conan/build.py
fi
fi
notifications:
email: off
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cometdlut/NanoRange.git
git@gitee.com:cometdlut/NanoRange.git
cometdlut
NanoRange
NanoRange
master

搜索帮助