cling/.travis.yml
2022-07-15 11:59:07 +02:00

255 lines
7.6 KiB
YAML

sudo: false
language: cpp
addons: &addons
apt:
packages: coreutils
env:
global:
- TIMEOUT=0
- secure: "MWXnhg939UrLRP7Jg5xLFxxquIgale0crNyP9Y2L2Pg+zINTgSExyykP/+s4uV1mj44uYLr4oEU7Ue72w3yGptanau90BUO+ZN5clC7QEUWsfJUDBc/ytilp+xhNRNLA+MJvaYLNOyXJOf9JKf/IzgRAR0m0PGAl9pMRG2vP5Sg="
# Do not build our sync branch.
branches:
except:
- /^__internal.*$/
only:
- master
- cling-nightlies
matrix:
# Abort all builds on a single failing matrix entry.
fast_finish: true
include:
# There seems to be a hard limit to how many machines a Travis build will
# run across all platforms. By interleaving OS X, the hope is to get in the
# queue faster while not blocking Linux builds from occuring.
- os: osx
env: COMPILER=clang++ CCOMPILER=clang
osx_image: xcode11
before_install:
- curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci;
source ./macports-ci install
compiler: clang
- os: linux
env: COMPILER=g++-5 CCOMPILER=gcc-5 NIGHTLY_CRON_SYNC=1
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-5
compiler: gcc-5
- os: linux
env: COMPILER=g++-6 CCOMPILER=gcc-6
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
compiler: gcc-6
- os: linux
env: COMPILER=g++-7 CCOMPILER=gcc-7
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-7
compiler: gcc-7
- os: linux
env: CXXLIB=libstdc++ COMPILER=clang++-3.9 CCOMPILER=clang-3.9
addons:
apt:
sources: llvm-toolchain-trusty-3.9
packages: clang-3.9
compiler: clang-3.9
- os: osx
env: COMPILER=clang++ CCOMPILER=clang
osx_image: xcode9.3
before_install:
- curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci;
source ./macports-ci install
compiler: clang
- os: linux
env: CXXLIB=libstdc++ COMPILER=clang++ CCOMPILER=clang
addons:
apt:
compiler: clang
# allow_failures:
# # clang-3.5 crashes compiling clang-3.9 with libc++-3.9
# - env: CXXLIB=libc++ COMPILER=clang++-3.5 CCOMPILER=clang-3.5
install:
# If cmake is not in the cache, download it.
- |
echo "travis_fold:""start:install"
CLING_USER_ROOT=`dirname $TRAVIS_BUILD_DIR`
export CLING_BUILD_DEPS="$CLING_USER_ROOT/deps"
export CLING_LOCAL_BIN="$CLING_USER_ROOT/bin"
if [ $TRAVIS_OS_NAME == 'osx' ]; then
brew install python coreutils
fi
if [ "$COMPILER" == "g++-7" ]; then
export CLING_BUILD_FLAGS="-DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON"
# On OS X force the test to reproduce __float128 issues with libstdc++.
if [ $TRAVIS_OS_NAME != 'osx' ]; then
export CLING_BUILD_FLAGS="$CLING_BUILD_FLAGS -DCXX_EXTENSIONS=OFF"
fi
fi
# Only care about cling warnings.
export CLING_BUILD_FLAGS="$CLING_BUILD_FLAGS -DCLANG_ENABLE_ARCMT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DLLVM_ENABLE_WARNINGS=OFF -DCLING_ENABLE_WARNINGS=ON"
echo "travis_fold:""end:install"
# Containers need to timeout before the buildscript exits
TIMEOUT='50m' # Any more and Travis might cancel
before_script:
- cmake --version
- export CXX="$COMPILER"
- export CC="$CCOMPILER"
- |
# If we are running our nightly cron job, sync.
if [ -n "$NIGHTLY_CRON_SYNC" ] && [ "$TRAVIS_EVENT_TYPE" = "cron" ] \
&& [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] \
&& [ "$TRAVIS_REPO_SLUG" == "vgvassilev/cling" ] ; then
echo "travis_fold:""start:sync-vgvassilev"
# Override the default travis clone command to enable sync.
cd ../../ && rm -fr ${TRAVIS_REPO_SLUG}
git clone https://$OAUTH_TOKEN@github.com/${TRAVIS_REPO_SLUG} ${TRAVIS_REPO_SLUG}
cd ${TRAVIS_REPO_SLUG}
echo "Syncing repository."
git remote add alt http://root.cern.ch/git/cling.git
git pull alt master
# Move the tag to newest master
git tag --force cling-nightlies master
# Push to origin
git push --verbose origin master
git push --verbose --force origin cling-nightlies
# Some debug output.
git remote -v && git branch -a
echo "travis_fold:""end:sync-vgvassilev"
fi
script:
- |
if [ -z $TRAVIS_TAG ]; then
TIMEOUTEXE=`which timeout`;
if [ "x" = "x$TIMEOUTEXE" ] ; then TIMEOUTEXE=gtimeout; fi
$TIMEOUTEXE -s SIGTERM $TIMEOUT tools/packaging/cpt.py -y \
--check-requirements \
--current-dev=tar \
--with-llvm-binary \
--with-llvm-tar \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
--with-clang-url=http://root.cern.ch/git/clang.git \
--with-cmake-flags="$CLING_BUILD_FLAGS" \
--skip-cleanup
else
tools/packaging/cpt.py -y \
--check-requirements \
--with-llvm-binary \
--with-llvm-tar \
--tarball-tag=$([[ $TRAVIS_TAG = cling-nightlies ]] && echo "master" || echo "$TRAVIS_TAG") \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
--with-clang-url=http://root.cern.ch/git/clang.git \
--with-cmake-flags="$CLING_BUILD_FLAGS"
fi
RESULT="$?"
echo "Build Result: $RESULT"
if [ $RESULT -ne 124 ]; then
return $RESULT
fi
# Timout occured, pass that on to after_failure so as not to dump logs
export CLING_BUILD_TIMEOUT=1
TRAVIS_TEST_RESULT=124
return $TRAVIS_TEST_RESULT
notifications:
email:
recipients:
#- cling-dev@cern.ch
on_success: change
on_failure: always
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{message}"
- "Build details: %{build_url}"
- "Change view : %{compare_url}"
before_deploy:
- |
echo "travis_fold:""start:before_deploy"
export RELEASE_TARBALL=$(ls $HOME/ci/build/cling*.tar.bz2)
if [[ $TRAVIS_TAG -eq "cling-nightlies" ]]; then
NIGHTLY="`dirname $RELEASE_TARBALL`/`date "+%Y-%b-%d-"``basename $RELEASE_TARBALL`"
echo "Renaming $RELEASE_TARBALL to $NIGHTLY"
mv $RELEASE_TARBALL $NIGHTLY
export RELEASE_TARBALL=$NIGHTLY
fi
echo "Deploying $RELEASE_TARBALL to GitHub releases"
echo "travis_fold:""end:before_deploy"
deploy:
provider: releases
skip_cleanup: true
api_key: $OAUTH_TOKEN
file: '${RELEASE_TARBALL}'
on:
tags: true
all_branches: true
repo: $TRAVIS_REPO_SLUG
after_failure:
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "travis_fold:""start:env_dump"
echo "Dumping env."
find $CLING_LOCAL_BIN -type f -print0 -exec cat {} \;
cmake --version
$CC --version
$CXX --version
ls -al `which ld` && ld -v
export
echo "travis_fold:""end:env_dump"
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "travis_fold:""start:cmakeoutputlog_dump"
echo "Dumping CMakeOutput.log"
cat /home/travis/ci/build/builddir/CMakeFiles/CMakeOutput.log
echo "travis_fold:""end:cmakeoutputlog_dump"
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "travis_fold:""start:cmakeerrorlog_dump"
echo "Dumping CMakeError.log"
cat /home/travis/ci/build/builddir/CMakeFiles/CMakeError.log
echo "travis_fold:""end:cmakeerrorlog_dump"
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "travis_fold:""start:clingcompiledata_dump"
echo "Dumping cling-compiledata.h..."
COMPILE_DATA_H=$HOME/ci/build/builddir/tools/cling/lib/Interpreter/cling-compiledata.h
cat $COMPILE_DATA_H
echo "Running cling-compiledata compiler..."
COMPDATA_CXX=$(cat $COMPILE_DATA_H | cut -c 18- | sed "s,\",,g")
eval echo | LC_ALL=C $COMPDATA_CXX -xc++ -E -v -
echo "travis_fold:""end:clingcompiledata_dump"
fi