diff --git a/.drone.star.disabled b/.drone.star similarity index 65% rename from .drone.star.disabled rename to .drone.star index b9ae6888..d3741e87 100644 --- a/.drone.star.disabled +++ b/.drone.star @@ -14,8 +14,8 @@ def main(ctx): return generate( # Compilers [ - 'gcc >=5.0', - 'clang >=3.9', + 'gcc >=12.0', + 'clang >=17.0', 'msvc >=14.1', 'arm64-gcc latest', 's390x-gcc latest', @@ -27,16 +27,12 @@ def main(ctx): 'x86-msvc latest' ], # Standards - '>=11', + '>=20', # Asan is delegated to GHA asan=False, docs=False, - cache_dir='cache') + [ - linux_cxx("GCC 12 (no-mutex)", "g++-12", packages="g++-12", buildscript="drone", buildtype="boost", - image="cppalliance/droneubuntu2204:1", - environment={'B2_TOOLSET': 'gcc-12', 'B2_DEFINES': 'BOOST_URL_DISABLE_THREADS=1', - 'B2_CXXSTD': '17'}, globalenv={'B2_CI_VERSION': '1', 'B2_VARIANT': 'release'}), - ] + coverage=False, + cache_dir='cache') # from https://github.com/cppalliance/ci-automation diff --git a/.drone/drone.bat b/.drone/drone.bat new file mode 100644 index 00000000..fa83aba6 --- /dev/null +++ b/.drone/drone.bat @@ -0,0 +1,47 @@ + +@ECHO ON +setlocal enabledelayedexpansion + +set TRAVIS_OS_NAME=windows + +IF "!DRONE_BRANCH!" == "" ( + for /F %%i in ("!GITHUB_REF!") do @set TRAVIS_BRANCH=%%~nxi +) else ( + SET TRAVIS_BRANCH=!DRONE_BRANCH! +) + +if "%DRONE_JOB_BUILDTYPE%" == "boost" ( + +echo "Running boost job" +echo '==================================> INSTALL' +REM there seems to be some problem with b2 bootstrap on Windows +REM when CXX env variable is set +SET "CXX=" + +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 +REM source ci/travis/install.sh +REM The contents of install.sh below: + +for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi +SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH! +SET BOOST_CI_SRC_FOLDER=%cd% +if "%BOOST_BRANCH%" == "" ( + SET BOOST_BRANCH=develop + if "%BOOST_CI_TARGET_BRANCH%" == "master" set BOOST_BRANCH=master +) + +call ci\common_install.bat + +echo '==================================> ZLIB' +git clone --branch v1.2.13 https://github.com/madler/zlib.git !BOOST_ROOT!\zlib-src --depth 1 +set ZLIB_SOURCE=!BOOST_ROOT!\zlib-src + +echo '==================================> COMPILE' + +REM set B2_TARGETS=libs/!SELF!/test libs/!SELF!/example +set B2_TARGETS=libs/!SELF!/test +call !BOOST_ROOT!\libs\!SELF!\ci\build.bat + +) diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100755 index 00000000..004fd0a6 --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,150 @@ +#!/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 () { + if [ -z "$SELF" ]; then + export SELF=`basename $REPO_NAME` + fi + + git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1 + [ "$SELF" == "boost-ci" ] || cp -prf boost-ci-cloned/ci . + rm -rf boost-ci-cloned + + if [ "$TRAVIS_OS_NAME" == "osx" ]; then + unset -f cd + fi + + export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH" + export BOOST_CI_SRC_FOLDER=$(pwd) + + . ./ci/common_install.sh +} + +if [[ $(uname) == "Linux" && "$B2_ASAN" == "1" ]]; then + echo 0 | sudo tee /proc/sys/kernel/randomize_va_space > /dev/null +fi + +if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then + +echo '==================================> INSTALL' + +common_install + +echo '==================================> SCRIPT' + +. $BOOST_ROOT/libs/$SELF/ci/build.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 +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" == "cmake1" ]; then + +set -xe + +echo '==================================> INSTALL' + +# already in the image +# pip install --user cmake + +echo '==================================> SCRIPT' + +export SELF=`basename $REPO_NAME` +BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true +echo BOOST_BRANCH: $BOOST_BRANCH +cd .. +git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root + +mkdir -p libs/$SELF +cp -r $DRONE_BUILD_DIR/* libs/$SELF +# git submodule update --init tools/boostdep +git submodule update --init --recursive + +cd libs/$SELF +mkdir __build__ && cd __build__ +cmake -DCMAKE_INSTALL_PREFIX=~/.local .. +cmake --build . --target install + +elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then + +echo '==================================> INSTALL' + +common_install + +echo '==================================> COMPILE' + +# Warnings as errors -Werror not building. Remove for now: +# export CXXFLAGS="-Wall -Wextra -Werror" +export CXXFLAGS="-Wall -Wextra" +export CMAKE_OPTIONS=${CMAKE_OPTIONS:--DBUILD_TESTING=ON} +export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1} + +mkdir __build_static +cd __build_static +cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \ + -DBOOST_INCLUDE_LIBRARIES=$SELF .. +cmake --build . +ctest --output-on-failure -R boost_$SELF + +cd .. + +if [ "$CMAKE_SHARED_LIBS" = 1 ]; then + +mkdir __build_shared +cd __build_shared +cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \ + -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON .. +cmake --build . +ctest --output-on-failure -R boost_$SELF + +fi + +fi