Add Drone CI

closes #2129
This commit is contained in:
sdarwin
2020-12-01 15:53:24 -06:00
committed by Richard Hodges
parent 33ea793020
commit a87330e53f
6 changed files with 247 additions and 1 deletions

3
.drone/README.md Normal file
View File

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

37
.drone/boost-script.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/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

39
.drone/docs-script.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/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

40
.drone/linux-cxx-install.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/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
ln -s /usr/bin/pip3 /usr/bin/pip
fi