Skip to content

Commit

Permalink
Added CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Feb 14, 2024
1 parent 7b5fe06 commit ef04d2a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def _b2_command(
address_model='64',
server_host='127.0.0.1',
separate_compilation=1,
use_ts_executor=0,
address_sanitizer=0,
undefined_sanitizer=0
):
Expand All @@ -40,6 +41,7 @@ def _b2_command(
'--address-model={} '.format(address_model) + \
'--server-host={} '.format(server_host) + \
'--separate-compilation={} '.format(separate_compilation) + \
'--use-ts-executor={} '.format(use_ts_executor) + \
'--address-sanitizer={} '.format(address_sanitizer) + \
'--undefined-sanitizer={} '.format(undefined_sanitizer)

Expand Down Expand Up @@ -135,6 +137,7 @@ def linux_b2(
stdlib='native',
address_model='64',
separate_compilation=1,
use_ts_executor = 0,
address_sanitizer=0,
undefined_sanitizer=0,
arch='amd64',
Expand All @@ -148,6 +151,7 @@ def linux_b2(
address_model=address_model,
server_host='mysql',
separate_compilation=separate_compilation,
use_ts_executor=use_ts_executor,
address_sanitizer=address_sanitizer,
undefined_sanitizer=undefined_sanitizer
)
Expand All @@ -167,15 +171,17 @@ def windows_b2(
toolset,
cxxstd,
variant,
address_model = '64'
address_model = '64',
use_ts_executor = 0
):
command = _b2_command(
source_dir='$Env:DRONE_WORKSPACE',
toolset=toolset,
cxxstd=cxxstd,
variant=variant,
address_model=address_model,
server_host='127.0.0.1'
server_host='127.0.0.1',
use_ts_executor=use_ts_executor
)
return _pipeline(name=name, image=image, os='windows', command=command, db=None)

Expand Down Expand Up @@ -265,6 +271,7 @@ def main(ctx):
linux_b2('Linux B2 clang-16-sanit', _image('build-clang16'), toolset='clang-16', cxxstd='20', address_sanitizer=1, undefined_sanitizer=1),
linux_b2('Linux B2 clang-16-i386-sanit', _image('build-clang16-i386'), toolset='clang-16', cxxstd='20', address_model=32, address_sanitizer=1, undefined_sanitizer=1),
linux_b2('Linux B2 gcc-5', _image('build-gcc5'), toolset='gcc-5', cxxstd='11'), # gcc-5 C++14 doesn't like my constexpr field_view
linux_b2('Linux B2 gcc-5-ts-executor', _image('build-gcc5'), toolset='gcc-5', cxxstd='11', use_ts_executor=1),
linux_b2('Linux B2 gcc-6', _image('build-gcc6'), toolset='gcc-6', cxxstd='14,17'),
linux_b2('Linux B2 gcc-10', _image('build-gcc10'), toolset='gcc-10', cxxstd='17,20'),
linux_b2('Linux B2 gcc-11', _image('build-gcc11'), toolset='gcc-11', cxxstd='20'),
Expand All @@ -274,10 +281,11 @@ def main(ctx):
linux_b2('Linux B2 gcc-13-sanit', _image('build-gcc13'), toolset='gcc-13', cxxstd='20', variant='debug', address_sanitizer=1, undefined_sanitizer=1),

# B2 Windows
windows_b2('Windows B2 msvc14.1 32-bit', _win_image('build-msvc14_1'), toolset='msvc-14.1', cxxstd='11,14,17', variant='release', address_model='32'),
windows_b2('Windows B2 msvc14.1 64-bit', _win_image('build-msvc14_1'), toolset='msvc-14.1', cxxstd='14,17', variant='release', address_model='64'),
windows_b2('Windows B2 msvc14.2', _win_image('build-msvc14_2'), toolset='msvc-14.2', cxxstd='14,17', variant='release', address_model='64'),
windows_b2('Windows B2 msvc14.3', _win_image('build-msvc14_3'), toolset='msvc-14.3', cxxstd='17,20', variant='debug,release', address_model='64'),
windows_b2('Windows B2 msvc14.1 32-bit', _win_image('build-msvc14_1'), toolset='msvc-14.1', cxxstd='11,14,17', variant='release', address_model='32'),
windows_b2('Windows B2 msvc14.1 64-bit', _win_image('build-msvc14_1'), toolset='msvc-14.1', cxxstd='14,17', variant='release'),
windows_b2('Windows B2 msvc14.2', _win_image('build-msvc14_2'), toolset='msvc-14.2', cxxstd='14,17', variant='release'),
windows_b2('Windows B2 msvc14.3', _win_image('build-msvc14_3'), toolset='msvc-14.3', cxxstd='17,20', variant='debug,release'),
windows_b2('Windows B2 msvc14.3-ts-executor', _win_image('build-msvc14_3'), toolset='msvc-14.3', cxxstd='20', variant='release', use_ts_executor=1),

# Docs
docs()
Expand Down
4 changes: 4 additions & 0 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ project /boost/mysql/test ;
# Support header-only builds
feature.feature boost.mysql.separate-compilation : on off : propagated composite ;

# Support builds with BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
feature.feature boost.mysql.use-ts-executor : on off : propagated composite ;

# System libraries
if [ os.name ] = NT
{
Expand Down Expand Up @@ -99,6 +102,7 @@ local requirements =
<target-os>windows:<define>_WIN32_WINNT=0x0601
<define>BOOST_ASIO_SEPARATE_COMPILATION
<include>../include
<boost.mysql.use-ts-executor>on:<define>BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
;

alias boost_mysql
Expand Down
4 changes: 4 additions & 0 deletions tools/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def _b2_build(
separate_compilation: bool = True,
address_sanitizer: bool = False,
undefined_sanitizer: bool = False,
use_ts_executor: bool = False,
) -> None:
# Config
os.environ['UBSAN_OPTIONS'] = 'print_stacktrace=1'
Expand Down Expand Up @@ -212,6 +213,7 @@ def _b2_build(
'variant={}'.format(variant),
'stdlib={}'.format(stdlib),
'boost.mysql.separate-compilation={}'.format('on' if separate_compilation else 'off'),
'boost.mysql.use-ts-executor={}'.format('on' if use_ts_executor else 'off'),
] + (['address-sanitizer=norecover'] if address_sanitizer else []) # can only be disabled by omitting the arg
+ (['undefined-sanitizer=norecover'] if undefined_sanitizer else []) # can only be disabled by omitting the arg
+ [
Expand Down Expand Up @@ -511,6 +513,7 @@ def main():
parser.add_argument('--stdlib', choices=['native', 'libc++'], default='native')
parser.add_argument('--address-model', choices=['32', '64'], default='64')
parser.add_argument('--separate-compilation', type=_str2bool, default=True)
parser.add_argument('--use-ts-executor', type=_str2bool, default=False)
parser.add_argument('--address-sanitizer', type=_str2bool, default=False)
parser.add_argument('--undefined-sanitizer', type=_str2bool, default=False)
parser.add_argument('--server-host', default='127.0.0.1')
Expand All @@ -529,6 +532,7 @@ def main():
stdlib=args.stdlib,
address_model=args.address_model,
separate_compilation=args.separate_compilation,
use_ts_executor=args.use_ts_executor,
address_sanitizer=args.address_sanitizer,
undefined_sanitizer=args.undefined_sanitizer,
clean=args.clean,
Expand Down
1 change: 1 addition & 0 deletions tools/scripts/build_unix_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ docker exec $CONTAINER python /opt/boost-mysql/tools/ci.py --source-dir=/opt/boo
--cxxstd=20 \
--variant=debug \
--separate-compilation=1 \
--use-ts-executor=0 \
--cmake-standalone-tests=1 \
--cmake-add-subdir-tests=1 \
--cmake-install-tests=1 \
Expand Down

0 comments on commit ef04d2a

Please sign in to comment.