Consolidate drone configs

closes #2256
This commit is contained in:
sdarwin
2021-06-09 20:08:45 +00:00
committed by Richard Hodges
parent 710cc53331
commit 03c4f0db4f
9 changed files with 244 additions and 245 deletions

View File

@@ -1,3 +0,0 @@
.drone.star and other drone scripts originally based on https://github.com/bfgroup/ci_playground

View File

@@ -1,38 +0,0 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
echo '==================================> BEFORE_INSTALL'
if [ "$DRONE_BEFORE_INSTALL" = "beast_coverage" ]; then
pip install --user https://github.com/codecov/codecov-python/archive/master.zip
wget http://downloads.sourceforge.net/ltp/lcov-1.14.tar.gz
tar -xvf lcov-1.14.tar.gz
cd lcov-1.14
make install
cd ..
fi
if [ "$DRONE_BEFORE_INSTALL" = "UBasan" ]; then
export PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
fi
echo '==================================> INSTALL'
cd ..
$TRAVIS_BUILD_DIR/tools/get-boost.sh $TRAVIS_BRANCH $TRAVIS_BUILD_DIR
cd boost-root
export PATH=$PATH:"`pwd`"
export BOOST_ROOT=$(pwd)
./bootstrap.sh
cp libs/beast/tools/user-config.jam ~/user-config.jam
echo "using $TOOLSET : : $COMPILER : $CXX_FLAGS ;" >> ~/user-config.jam
echo '==================================> COMPILE'
cd ../boost-root
libs/beast/tools/retry.sh libs/beast/tools/build-and-test.sh

View File

@@ -1,39 +0,0 @@
#!/bin/bash
set -ex
export BOOST_CI_SRC_FOLDER=$(pwd)
echo '==================================> INSTALL'
pwd
cd ..
mkdir -p $HOME/cache && cd $HOME/cache
if [ ! -d doxygen ]; then git clone -b 'Release_1_8_15' --depth 1 https://github.com/doxygen/doxygen.git && echo "not-cached" ; else echo "cached" ; fi
cd doxygen
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release
cd build
sudo make install
cd ../..
if [ ! -f saxonhe.zip ]; then wget -O saxonhe.zip https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/SaxonHE9-9-1-4J.zip/download && echo "not-cached" ; else echo "cached" ; fi
unzip -o saxonhe.zip
sudo rm /usr/share/java/Saxon-HE.jar
sudo cp saxon9he.jar /usr/share/java/Saxon-HE.jar
cd ..
BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true
git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root --depth 1
cd boost-root
export BOOST_ROOT=$(pwd)
git submodule update --init libs/context
git submodule update --init tools/boostbook
git submodule update --init tools/boostdep
git submodule update --init tools/docca
git submodule update --init tools/quickbook
rsync -av $BOOST_CI_SRC_FOLDER/ libs/json
python tools/boostdep/depinst/depinst.py ../tools/quickbook
./bootstrap.sh
./b2 headers
echo '==================================> COMPILE'
echo "using doxygen ; using boostbook ; using saxonhe ;" > tools/build/src/user-config.jam
./b2 -j3 libs/json/doc//boostrelease

View File

@@ -2,6 +2,8 @@
@ECHO ON
setlocal enabledelayedexpansion
if "%DRONE_JOB_BUILDTYPE%" == "boost" (
echo "============> INSTALL"
SET DRONE_BUILD_DIR=%CD: =%
@@ -12,7 +14,7 @@ SET BOOST_BRANCH=develop
IF "%DRONE_BRANCH%" == "master" SET BOOST_BRANCH=master
cp tools\user-config.jam %USERPROFILE%\user-config.jam
cd ..
SET GET_BOOST=%DRONE_BUILD_DIR%\tools\get-boost.sh
SET GET_BOOST=!DRONE_BUILD_DIR!\tools\get-boost.sh
bash -c "$GET_BOOST $DRONE_BRANCH $DRONE_BUILD_DIR"
cd boost-root
call bootstrap.bat
@@ -22,14 +24,16 @@ echo "============> SCRIPT"
echo "Running tests"
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test -j3
if %errorlevel% neq 0 exit /b %errorlevel%
if !errorlevel! neq 0 exit /b !errorlevel!
echo "Running libs/beast/example"
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% libs/beast/example -j3
if %errorlevel% neq 0 exit /b %errorlevel%
if !errorlevel! neq 0 exit /b !errorlevel!
echo "Running run-fat-tests"
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test//run-fat-tests -j3
if %errorlevel% neq 0 exit /b %errorlevel%
if !errorlevel! neq 0 exit /b !errorlevel!
echo "============> COMPLETED"
)

186
.drone/drone.sh Executable file
View File

@@ -0,0 +1,186 @@
#!/bin/bash
# Copyright 2020 Rene Rivera, Sam Darwin
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)
set -xe
export DRONE_BUILD_DIR=$(pwd)
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export REPO_NAME=$DRONE_REPO
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export TRAVIS_EVENT_TYPE=$DRONE_BUILD_EVENT
common_install () {
git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
cp -prf boost-ci-cloned/ci .
rm -rf boost-ci-cloned
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
unset -f cd
echo "macos - set up homebrew openssl"
export OPENSSL_ROOT=/usr/local/opt/openssl
cat > ~/user-config.jam <<EOF
import os ;
local OPENSSL_ROOT = [ os.environ OPENSSL_ROOT ] ;
project
: requirements
<include>/usr/local/opt/openssl/include
<variant>debug:<library-path>/usr/local/opt/openssl/lib
<target-os>windows<variant>debug:<library-path>/usr/local/opt/openssl/debug/lib
<variant>release:<library-path>/usr/local/opt/openssl/lib
;
EOF
fi
export SELF=`basename $REPO_NAME`
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
export BOOST_CI_SRC_FOLDER=$(pwd)
. ./ci/common_install.sh
}
if [ "$DRONE_BEFORE_INSTALL" == "beast_coverage" ]; then
LCOV_VERSION=${LCOV_VERSION:-1.14}
pip install --user https://github.com/codecov/codecov-python/archive/master.zip
wget http://downloads.sourceforge.net/ltp/lcov-$LCOV_VERSION.tar.gz
tar -xvf lcov-$LCOV_VERSION.tar.gz
cd lcov-$LCOV_VERSION
make install
cd ..
fi
if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
common_install
echo '==================================> SCRIPT'
if [ -n "$COMPILER" ] && [ -n "$B2_TOOLSET" ]; then
echo "using $B2_TOOLSET : : $COMPILER ;" >> ~/user-config.jam
fi
. $BOOST_ROOT/libs/$SELF/ci/build.sh
elif [ "$DRONE_JOB_BUILDTYPE" == "boost_v1" ]; then
# version based on the earlier boost.beast .travis.yml configuration
echo '==================================> INSTALL'
export SELF=`basename $REPO_NAME`
export BEAST_RETRY=False
export TRAVIS=False
BOOST_BRANCH=develop
if [ "$DRONE_BRANCH" == "master" ]; then
BOOST_BRANCH=master
fi
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
export BOOST_ROOT=$(pwd)
export PATH=$PATH:$BOOST_ROOT
# git submodule update --init tools/boostdep
# python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $SELF
git submodule update --init --depth 20 --jobs 4
rm -rf libs/$SELF
cp -r $DRONE_BUILD_DIR libs/$SELF
./bootstrap.sh
cp libs/beast/tools/user-config.jam ~/user-config.jam
echo "using $TOOLSET : : $COMPILER : $CXX_FLAGS ;" >> ~/user-config.jam
# ./b2 -d0 headers
echo '==================================> SCRIPT'
cd $BOOST_ROOT
libs/beast/tools/retry.sh libs/beast/tools/build-and-test.sh
elif [ "$DRONE_JOB_BUILDTYPE" == "codecov" ]; then
echo '==================================> INSTALL'
common_install
echo '==================================> SCRIPT'
cd $BOOST_ROOT/libs/$SELF
ci/travis/codecov.sh
elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then
echo '==================================> INSTALL'
common_install
echo '==================================> SCRIPT'
cd $BOOST_ROOT/libs/$SELF
VALGRIND_OPTS="$VALGRIND_OPTS --suppressions=$BOOST_ROOT/libs/$SELF/tools/valgrind.supp"
echo "VALGRIND_OPTS is $VALGRIND_OPTS"
ci/travis/valgrind.sh
elif [ "$DRONE_JOB_BUILDTYPE" == "coverity" ]; then
echo '==================================> INSTALL'
common_install
echo '==================================> SCRIPT'
if [ -n "${COVERITY_SCAN_NOTIFICATION_EMAIL}" -a \( "$TRAVIS_BRANCH" = "develop" -o "$TRAVIS_BRANCH" = "master" \) -a \( "$DRONE_BUILD_EVENT" = "push" -o "$DRONE_BUILD_EVENT" = "cron" \) ] ; then
cd $BOOST_ROOT/libs/$SELF
ci/travis/coverity.sh
fi
elif [ "$DRONE_JOB_BUILDTYPE" == "docs" ]; then
export BOOST_CI_SRC_FOLDER=$(pwd)
echo '==================================> INSTALL'
pwd
cd ..
mkdir -p $HOME/cache && cd $HOME/cache
if [ ! -d doxygen ]; then git clone -b 'Release_1_8_15' --depth 1 https://github.com/doxygen/doxygen.git && echo "not-cached" ; else echo "cached" ; fi
cd doxygen
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release
cd build
sudo make install
cd ../..
if [ ! -f saxonhe.zip ]; then wget -O saxonhe.zip https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/SaxonHE9-9-1-4J.zip/download && echo "not-cached" ; else echo "cached" ; fi
unzip -o saxonhe.zip
sudo rm /usr/share/java/Saxon-HE.jar
sudo cp saxon9he.jar /usr/share/java/Saxon-HE.jar
cd ..
BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true
git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root --depth 1
cd boost-root
export BOOST_ROOT=$(pwd)
git submodule update --init libs/context
git submodule update --init tools/boostbook
git submodule update --init tools/boostdep
git submodule update --init tools/docca
git submodule update --init tools/quickbook
rsync -av $BOOST_CI_SRC_FOLDER/ libs/json
python tools/boostdep/depinst/depinst.py ../tools/quickbook
./bootstrap.sh
./b2 headers
echo '==================================> COMPILE'
echo "using doxygen ; using boostbook ; using saxonhe ;" > tools/build/src/user-config.jam
./b2 -j3 libs/json/doc//boostrelease
fi

View File

@@ -1,40 +0,0 @@
#!/bin/bash
set -ex
echo ">>>>> APT: REPO.."
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
if test -n "${LLVM_OS}" ; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
if test -n "${LLVM_VER}" ; then
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
else
# Snapshot (i.e. trunk) build of clang
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS} main"
fi
elif [[ $CXX =~ ^clang || $TOOLSET =~ ^clang || $B2_TOOLSET =~ ^clang ]]; then
# Default Travis Installation of clang-7
LLVM_OS=$(awk -F= '$1=="VERSION_CODENAME" { print $2 ;}' /etc/os-release)
LLVM_VER="7"
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
sudo -E apt-get -o Acquire::Retries=3 update
sudo -E apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install libstdc++-8-dev clang-7 libc++-7-dev libc++-helpers libc++abi-7-dev
ln -s /usr/bin/clang-7 /usr/bin/clang
ln -s /usr/bin/clang /usr/bin/clang++
fi
echo ">>>>> APT: UPDATE.."
sudo -E apt-get -o Acquire::Retries=3 update
echo ">>>>> APT: INSTALL ${PACKAGES}.."
sudo -E apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES}
MAJOR_VERSION=$(lsb_release -r -s | cut -c 1-2)
if [ "$MAJOR_VERSION" -lt "20" ]; then
sudo -E apt-get -o Acquire::Retries=3 -y install python python-pip
fi
if [ "$MAJOR_VERSION" -gt "18" ]; then
sudo -E apt-get -o Acquire::Retries=3 -y install python3 python3-pip
ln -s /usr/bin/python3 /usr/bin/python || true
ln -s /usr/bin/pip3 /usr/bin/pip || true
fi

View File

@@ -1,2 +0,0 @@
true