加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.travis.yml 3.28 KB
一键复制 编辑 原始数据 按行查看 历史
sudo: false
language: cpp
os:
- linux
compiler:
- gcc
- clang
cache:
- ccache
stages:
- canary
- test
jobs:
include:
- stage: canary
env: CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
os: linux
branches:
only:
- master
- develop
- /^release/
env:
-
# - BACKEND="OPENMP"
- BACKEND="PTHREAD"
- CMAKE_BUILD_TYPE=Debug COVERAGE=yes GTEST_FILTER="-*DeathTest*"
- CMAKE_BUILD_TYPE=Debug BACKEND="OPENMP" COVERAGE=yes GTEST_FILTER="-*DeathTest*"
# - CMAKE_BUILD_TYPE=Debug BACKEND="PTHREAD" COVERAGE=yes
- CMAKE_BUILD_TYPE=Release
- CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
# - CMAKE_BUILD_TYPE=Release BACKEND="PTHREAD"
matrix:
exclude:
- os: linux
compiler: gcc
env: CMAKE_BUILD_TYPE=Release BACKEND="OPENMP"
# Install newer CMake. The distribution comes with CMake 3.12.4 but we require at least 3.16
install:
- CMAKE_VERSION=3.17.1
- CMAKE_DIR=/opt/cmake
- CMAKE_KEY=2D2CEF1034921684 &&
CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} &&
CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh &&
CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt &&
wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} &&
wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc &&
wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} &&
#gpg --keyserver pool.sks-keyservers.net --recv-keys ${CMAKE_KEY} &&
#gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} &&
#grep ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sha256sum --check &&
mkdir -p ${CMAKE_DIR} &&
sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} &&
rm cmake*
- PATH=${CMAKE_DIR}/bin:$PATH
- cd ${TRAVIS_BUILD_DIR}
before_script:
- ccache -z
- if [[ ${COVERAGE} ]]; then export CXX="${CXX} --coverage"; fi
- if [[ ! ${CMAKE_BUILD_TYPE} ]]; then export CXXFLAGS="${CXXFLAGS} -O2"; fi
script:
- export OMP_NUM_THREADS=2
- export OMP_PLACES=threads
- export OMP_PROC_BIND=spread
# LD_LIBRARY_PATH workaround to find clang's libomp: https://github.com/travis-ci/travis-ci/issues/8613
- if [[ ${CC} = clang ]]; then export LD_LIBRARY_PATH=/usr/local/clang/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH; fi
# enable ccache for clang on linux and add CCACHE_CPP2 to avoid 'Argument unused during compilation -I...' warning
- if [[ ${TRAVIS_OS_NAME} = linux && ${CC} = clang ]]; then
ln -s /usr/bin/ccache $HOME/bin/clang++;
export CCACHE_CPP2=yes;
fi
- mkdir build &&
pushd build &&
cmake ..
${BACKEND:+-DKokkos_ENABLE_${BACKEND}=On}
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -Werror"
-DCMAKE_CXX_STANDARD=14
-DKokkos_ENABLE_COMPILER_WARNINGS=ON
-DKokkos_ENABLE_TESTS=On
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}} &&
make VERBOSE=1 -j2 &&
travis_wait 60 make test CTEST_OUTPUT_ON_FAILURE=1 &&
make install DESTDIR=${PWD}/install && rm -rf ${PWD}/install/usr/local && rmdir ${PWD}/install/usr &&
popd
after_success:
- ccache -s
- if [[ ${COVERAGE} ]]; then
mkdir -p $HOME/.local/bin && wget -O $HOME/.local/bin/codecov https://codecov.io/bash && chmod +x $HOME/.local/bin/codecov;
pushd build &&
if [[ ${CC} = clang* ]]; then
codecov -x "llvm-cov gcov" -F "${CC}";
else
codecov -x gcov -F "${CC}";
fi;
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化