Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 74 additions & 11 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,94 @@
#
#

globalenv = {
'B2_CI_VERSION': '1',
'B2_VARIANT': 'debug,release',
'B2_FLAGS': 'warnings=extra warnings-as-errors=on',
}

def main(ctx):
return generate(
# Compilers
# generate() provides: main compiler matrix, asan, ubsan, coverage,
# and cmake-superproject (linux/latest gcc) by default
jobs = generate(
[
'gcc >=12.0',
'clang >=17.0',
'msvc >=14.1',
'arm64-gcc latest',
's390x-gcc latest',
# 'freebsd-gcc latest',
'apple-clang *',
# apple-clang: added as explicit osx_cxx() below because
# generate() only supports C++11/14/17 for apple-clang
'arm64-clang latest',
's390x-clang latest',
'freebsd-clang latest',
# freebsd-clang: added as explicit freebsd_cxx() below to
# target FreeBSD >=14 (system clang >=17 needed for <coroutine>)
'x86-msvc latest'
],
# Standards
'>=20',
# Asan is delegated to GHA
asan=False,
docs=False,
coverage=False,
cache_dir='cache')

# macOS: generate() skips apple-clang when cxx_range='>=20' because
# ci-automation's compiler_supports() doesn't list C++20 for apple-clang
jobs += [
osx_cxx("macOS: Clang 16.2.0", "clang++", packages="",
buildscript="drone", buildtype="boost",
xcode_version="16.2.0",
environment={
'B2_TOOLSET': 'clang',
'B2_CXXSTD': '20',
'B2_CXXFLAGS': '-fexperimental-library',
},
globalenv=globalenv),
]

# Jobs not covered by generate()
jobs += [
linux_cxx("Valgrind", "clang++-17", packages="clang-17 libc6-dbg libstdc++-12-dev",
llvm_os="jammy", llvm_ver="17",
buildscript="drone", buildtype="valgrind",
image="cppalliance/droneubuntu2204:1",
environment={
'COMMENT': 'valgrind',
'B2_TOOLSET': 'clang-17',
'B2_CXXSTD': '20',
'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1',
'B2_VARIANT': 'debug',
'B2_TESTFLAGS': 'testing.launcher=valgrind',
'VALGRIND_OPTS': '--error-exitcode=1',
},
globalenv=globalenv),

linux_cxx("cmake-mainproject", "g++-13", packages="g++-13",
image="cppalliance/droneubuntu2404:1",
buildtype="cmake-mainproject", buildscript="drone",
environment={
'COMMENT': 'cmake-mainproject',
'CXX': 'g++-13',
},
globalenv=globalenv),

linux_cxx("cmake-subdirectory", "g++-13", packages="g++-13",
image="cppalliance/droneubuntu2404:1",
buildtype="cmake-subdirectory", buildscript="drone",
environment={
'COMMENT': 'cmake-subdirectory',
'CXX': 'g++-13',
},
globalenv=globalenv),

windows_cxx("msvc-14.3 cmake-superproject", "",
image="cppalliance/dronevs2022:1",
buildtype="cmake-superproject", buildscript="drone",
environment={
'B2_TOOLSET': 'msvc-14.3',
'B2_CXXSTD': '20',
},
globalenv=globalenv),
]

return jobs


# from https://github.com/cppalliance/ci-automation
load("@ci_automation//ci/drone/:functions.star", "linux_cxx", "windows_cxx", "osx_cxx", "freebsd_cxx", "generate")

144 changes: 139 additions & 5 deletions .drone/drone.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,148 @@ if "%BOOST_BRANCH%" == "" (

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

) else if "%DRONE_JOB_BUILDTYPE%" == "cmake-superproject" (

echo "Running cmake superproject job"
echo '==================================> INSTALL'
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

for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
SET BOOST_CI_SRC_FOLDER=%cd%

call ci\common_install.bat

echo '==================================> COMPILE'

if "!CMAKE_NO_TESTS!" == "" (
SET CMAKE_NO_TESTS=error
)
if "!CMAKE_NO_TESTS!" == "error" (
SET CMAKE_BUILD_TESTING=-DBUILD_TESTING=ON
)

cd ../../

mkdir __build_static && cd __build_static
cmake -DBoost_VERBOSE=1 !CMAKE_BUILD_TESTING! -DCMAKE_INSTALL_PREFIX=iprefix ^
-DBOOST_INCLUDE_LIBRARIES=!SELF! !CMAKE_OPTIONS! ..

cmake --build . --target install --config Debug
if NOT "!CMAKE_BUILD_TESTING!" == "" (
cmake --build . --target tests --config Debug
)
ctest --output-on-failure --no-tests=!CMAKE_NO_TESTS! -C Debug

cmake --build . --target install --config Release
if NOT "!CMAKE_BUILD_TESTING!" == "" (
cmake --build . --target tests --config Release
)
ctest --output-on-failure --no-tests=!CMAKE_NO_TESTS! -C Release
cd ..

if "!CMAKE_SHARED_LIBS!" == "" (
SET CMAKE_SHARED_LIBS=1
)
if "!CMAKE_SHARED_LIBS!" == "1" (

mkdir __build_shared && cd __build_shared
cmake -DBoost_VERBOSE=1 !CMAKE_BUILD_TESTING! -DCMAKE_INSTALL_PREFIX=iprefix ^
-DBOOST_INCLUDE_LIBRARIES=!SELF! -DBUILD_SHARED_LIBS=ON !CMAKE_OPTIONS! ..

cmake --build . --config Debug
cmake --build . --target install --config Debug
if NOT "!CMAKE_BUILD_TESTING!" == "" (
cmake --build . --target tests --config Debug
)
ctest --output-on-failure --no-tests=!CMAKE_NO_TESTS! -C Debug

cmake --build . --config Release
cmake --build . --target install --config Release
if NOT "!CMAKE_BUILD_TESTING!" == "" (
cmake --build . --target tests --config Release
)
ctest --output-on-failure --no-tests=!CMAKE_NO_TESTS! -C Release

)

) else if "%DRONE_JOB_BUILDTYPE%" == "cmake-mainproject" (

echo "Running cmake main project job"
echo '==================================> INSTALL'
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

for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
SET BOOST_CI_SRC_FOLDER=%cd%

call ci\common_install.bat

echo '==================================> COMPILE'

if "!CMAKE_NO_TESTS!" == "" (
SET CMAKE_NO_TESTS=error
)
if "!CMAKE_NO_TESTS!" == "error" (
SET CMAKE_BUILD_TESTING=-DBUILD_TESTING=ON
)

cd ../../

mkdir __build_static && cd __build_static
cmake -DBoost_VERBOSE=1 !CMAKE_BUILD_TESTING! -DCMAKE_INSTALL_PREFIX=iprefix ^
!CMAKE_OPTIONS! ../libs/!SELF!
cmake --build . --target install --config Debug
ctest --output-on-failure --no-tests=error -R boost_!SELF! -C Debug

cmake --build . --target install --config Release
ctest --output-on-failure --no-tests=error -R boost_!SELF! -C Release

) else if "%DRONE_JOB_BUILDTYPE%" == "cmake-subdirectory" (

echo "Running cmake subdirectory job"
echo '==================================> INSTALL'
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

for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
SET BOOST_CI_SRC_FOLDER=%cd%

call ci\common_install.bat

echo '==================================> COMPILE'

if "!CMAKE_NO_TESTS!" == "" (
SET CMAKE_NO_TESTS=error
)
if "!CMAKE_NO_TESTS!" == "error" (
SET CMAKE_BUILD_TESTING=-DBUILD_TESTING=ON
)

cd ../../

mkdir __build_static && cd __build_static
cmake !CMAKE_BUILD_TESTING! !CMAKE_OPTIONS! ../libs/!SELF!/test/cmake_test
cmake --build . --config Debug
cmake --build . --target check --config Debug
cmake --build . --config Release
cmake --build . --target check --config Release

)
103 changes: 74 additions & 29 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,65 +85,110 @@ cd $BOOST_ROOT/libs/$SELF
ci/travis/coverity.sh
fi

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake1" ]; then
elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then

set -xe
echo '==================================> INSTALL'

common_install

echo '==================================> COMPILE'

export CXXFLAGS="-Wall -Wextra -Werror"
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}
export CMAKE_NO_TESTS=${CMAKE_NO_TESTS:-error}
if [ $CMAKE_NO_TESTS = "error" ]; then
CMAKE_BUILD_TESTING="-DBUILD_TESTING=ON"
fi

mkdir __build_static
cd __build_static
cmake -DBoost_VERBOSE=1 ${CMAKE_BUILD_TESTING} -DCMAKE_INSTALL_PREFIX=iprefix \
-DBOOST_INCLUDE_LIBRARIES=$SELF ${CMAKE_OPTIONS} ..
if [ -n "${CMAKE_BUILD_TESTING}" ]; then
cmake --build . --target tests
fi
cmake --build . --target install
ctest --output-on-failure --no-tests=$CMAKE_NO_TESTS
cd ..

if [ "$CMAKE_SHARED_LIBS" = 1 ]; then

mkdir __build_shared
cd __build_shared
cmake -DBoost_VERBOSE=1 ${CMAKE_BUILD_TESTING} -DCMAKE_INSTALL_PREFIX=iprefix \
-DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON ${CMAKE_OPTIONS} ..
if [ -n "${CMAKE_BUILD_TESTING}" ]; then
cmake --build . --target tests
fi
cmake --build . --target install
ctest --output-on-failure --no-tests=$CMAKE_NO_TESTS

fi

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-mainproject" ]; then

echo '==================================> INSTALL'

# already in the image
# pip install --user cmake
common_install

echo '==================================> SCRIPT'
echo '==================================> COMPILE'

export SELF=`basename $REPO_NAME`
BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
export CXXFLAGS="-Wall -Wextra -Werror"
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}
export CMAKE_NO_TESTS=${CMAKE_NO_TESTS:-error}
if [ $CMAKE_NO_TESTS = "error" ]; then
CMAKE_BUILD_TESTING="-DBUILD_TESTING=ON"
fi

mkdir __build_static
cd __build_static
cmake -DBoost_VERBOSE=1 ${CMAKE_BUILD_TESTING} -DCMAKE_INSTALL_PREFIX=iprefix \
${CMAKE_OPTIONS} ../libs/$SELF
cmake --build . --target install
ctest --output-on-failure --no-tests=$CMAKE_NO_TESTS
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
if [ "$CMAKE_SHARED_LIBS" = 1 ]; then

cd libs/$SELF
mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
mkdir __build_shared
cd __build_shared
cmake -DBoost_VERBOSE=1 ${CMAKE_BUILD_TESTING} -DCMAKE_INSTALL_PREFIX=iprefix \
-DBUILD_SHARED_LIBS=ON ${CMAKE_OPTIONS} ../libs/$SELF
cmake --build . --target install
ctest --output-on-failure --no-tests=$CMAKE_NO_TESTS

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then
fi

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-subdirectory" ]; 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 CXXFLAGS="-Wall -Wextra -Werror"
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}
export CMAKE_NO_TESTS=${CMAKE_NO_TESTS:-error}
if [ $CMAKE_NO_TESTS = "error" ]; then
CMAKE_BUILD_TESTING="-DBUILD_TESTING=ON"
fi

mkdir __build_static
cd __build_static
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
-DBOOST_INCLUDE_LIBRARIES=$SELF ..
cmake ${CMAKE_BUILD_TESTING} ${CMAKE_OPTIONS} ../libs/$SELF/test/cmake_test
cmake --build .
ctest --output-on-failure -R boost_$SELF

cmake --build . --target check
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 ${CMAKE_BUILD_TESTING} -DBUILD_SHARED_LIBS=ON ${CMAKE_OPTIONS} \
../libs/$SELF/test/cmake_test
cmake --build .
ctest --output-on-failure -R boost_$SELF
cmake --build . --target check

fi

Expand Down
Loading
Loading