Skip to content

Commit d24701f

Browse files
committed
Update doc and CI scripts
1 parent 85c055b commit d24701f

File tree

19 files changed

+1030
-70784
lines changed

19 files changed

+1030
-70784
lines changed

.drone/drone.bat

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
@ECHO ON
3+
setlocal enabledelayedexpansion
4+
5+
set TRAVIS_OS_NAME=windows
6+
7+
IF "!DRONE_BRANCH!" == "" (
8+
for /F %%i in ("!GITHUB_REF!") do @set TRAVIS_BRANCH=%%~nxi
9+
) else (
10+
SET TRAVIS_BRANCH=!DRONE_BRANCH!
11+
)
12+
13+
if "%DRONE_JOB_BUILDTYPE%" == "boost" (
14+
15+
echo "Running boost job"
16+
echo '==================================> INSTALL'
17+
REM there seems to be some problem with b2 bootstrap on Windows
18+
REM when CXX env variable is set
19+
SET "CXX="
20+
21+
git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
22+
cp -prf boost-ci-cloned/ci .
23+
rm -rf boost-ci-cloned
24+
REM source ci/travis/install.sh
25+
REM The contents of install.sh below:
26+
27+
for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
28+
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
29+
SET BOOST_CI_SRC_FOLDER=%cd%
30+
if "%BOOST_BRANCH%" == "" (
31+
SET BOOST_BRANCH=develop
32+
if "%BOOST_CI_TARGET_BRANCH%" == "master" set BOOST_BRANCH=master
33+
)
34+
35+
call ci\common_install.bat
36+
37+
echo '==================================> ZLIB'
38+
git clone --branch v1.2.13 https://github.com/madler/zlib.git !BOOST_ROOT!\zlib-src --depth 1
39+
set ZLIB_SOURCE=!BOOST_ROOT!\zlib-src
40+
41+
echo using zlib : : : ^<warnings^>off ^; >> !BOOST_ROOT!\project-config.jam
42+
43+
REM Customizations
44+
cd
45+
pushd !BOOST_ROOT!\libs
46+
git clone https://github.com/cppalliance/buffers -b !BOOST_BRANCH! --depth 1
47+
popd
48+
pushd !BOOST_ROOT!\libs
49+
git clone https://github.com/cppalliance/http_proto -b !BOOST_BRANCH! --depth 1
50+
popd
51+
pushd !BOOST_ROOT!\libs
52+
git clone https://github.com/cppalliance/ws_proto -b !BOOST_BRANCH! --depth 1
53+
popd
54+
55+
pushd !BOOST_ROOT!
56+
python tools/boostdep/depinst/depinst.py buffers
57+
python tools/boostdep/depinst/depinst.py http_proto
58+
python tools/boostdep/depinst/depinst.py ws_proto
59+
python tools/boostdep/depinst/depinst.py ws_io
60+
popd
61+
62+
echo '==================================> COMPILE'
63+
64+
REM set B2_TARGETS=libs/!SELF!/test libs/!SELF!/example
65+
set B2_TARGETS=libs/!SELF!/test
66+
call !BOOST_ROOT!\libs\!SELF!\ci\build.bat
67+
68+
)

.drone/drone.sh

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 Rene Rivera, Sam Darwin
4+
# Distributed under the Boost Software License, Version 1.0.
5+
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)
6+
7+
set -xe
8+
9+
export DRONE_BUILD_DIR=$(pwd)
10+
export VCS_COMMIT_ID=$DRONE_COMMIT
11+
export GIT_COMMIT=$DRONE_COMMIT
12+
export REPO_NAME=$DRONE_REPO
13+
export USER=$(whoami)
14+
export CC=${CC:-gcc}
15+
export PATH=~/.local/bin:/usr/local/bin:$PATH
16+
export TRAVIS_BUILD_DIR=$(pwd)
17+
export TRAVIS_BRANCH=$DRONE_BRANCH
18+
export TRAVIS_EVENT_TYPE=$DRONE_BUILD_EVENT
19+
20+
common_install () {
21+
if [ -z "$SELF" ]; then
22+
export SELF=`basename $REPO_NAME`
23+
fi
24+
25+
git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
26+
[ "$SELF" == "boost-ci" ] || cp -prf boost-ci-cloned/ci .
27+
rm -rf boost-ci-cloned
28+
29+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
30+
unset -f cd
31+
fi
32+
33+
export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
34+
export BOOST_CI_SRC_FOLDER=$(pwd)
35+
36+
. ./ci/common_install.sh
37+
38+
if [ ! -d "$BOOST_ROOT/libs/buffers" ]; then
39+
pushd $BOOST_ROOT/libs
40+
git clone https://github.com/cppalliance/buffers -b $BOOST_BRANCH --depth 1
41+
popd
42+
fi
43+
44+
if [ ! -d "$BOOST_ROOT/libs/http_proto" ]; then
45+
pushd $BOOST_ROOT/libs
46+
git clone https://github.com/cppalliance/http_proto -b $BOOST_BRANCH --depth 1
47+
popd
48+
fi
49+
50+
if [ ! -d "$BOOST_ROOT/libs/ws_proto" ]; then
51+
pushd $BOOST_ROOT/libs
52+
git clone https://github.com/cppalliance/ws_proto -b $BOOST_BRANCH --depth 1
53+
popd
54+
fi
55+
56+
pushd $BOOST_ROOT
57+
$pythonexecutable tools/boostdep/depinst/depinst.py buffers
58+
$pythonexecutable tools/boostdep/depinst/depinst.py http_proto
59+
$pythonexecutable tools/boostdep/depinst/depinst.py ws_proto
60+
$pythonexecutable tools/boostdep/depinst/depinst.py ws_io
61+
popd
62+
}
63+
64+
if [[ $(uname) == "Linux" && "$B2_ASAN" == "1" ]]; then
65+
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space > /dev/null
66+
fi
67+
68+
if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then
69+
70+
echo '==================================> INSTALL'
71+
72+
common_install
73+
74+
echo '==================================> SCRIPT'
75+
76+
. $BOOST_ROOT/libs/$SELF/ci/build.sh
77+
78+
elif [ "$DRONE_JOB_BUILDTYPE" == "codecov" ]; then
79+
80+
echo '==================================> INSTALL'
81+
82+
common_install
83+
84+
echo '==================================> SCRIPT'
85+
86+
cd $BOOST_ROOT/libs/$SELF
87+
ci/travis/codecov.sh
88+
89+
elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then
90+
91+
echo '==================================> INSTALL'
92+
93+
common_install
94+
95+
echo '==================================> SCRIPT'
96+
97+
cd $BOOST_ROOT/libs/$SELF
98+
ci/travis/valgrind.sh
99+
100+
elif [ "$DRONE_JOB_BUILDTYPE" == "coverity" ]; then
101+
102+
echo '==================================> INSTALL'
103+
104+
common_install
105+
106+
echo '==================================> SCRIPT'
107+
108+
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
109+
cd $BOOST_ROOT/libs/$SELF
110+
ci/travis/coverity.sh
111+
fi
112+
113+
elif [ "$DRONE_JOB_BUILDTYPE" == "cmake1" ]; then
114+
115+
set -xe
116+
117+
echo '==================================> INSTALL'
118+
119+
# already in the image
120+
# pip install --user cmake
121+
122+
echo '==================================> SCRIPT'
123+
124+
export SELF=`basename $REPO_NAME`
125+
BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true
126+
echo BOOST_BRANCH: $BOOST_BRANCH
127+
cd ..
128+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
129+
cd boost-root
130+
131+
mkdir -p libs/$SELF
132+
cp -r $DRONE_BUILD_DIR/* libs/$SELF
133+
# git submodule update --init tools/boostdep
134+
git submodule update --init --recursive
135+
136+
# Customizations
137+
if [ ! -d "$BOOST_ROOT/libs/buffers" ]; then
138+
pushd $BOOST_ROOT/libs
139+
git clone https://github.com/cppalliance/buffers -b $BOOST_BRANCH --depth 1
140+
popd
141+
fi
142+
143+
if [ ! -d "$BOOST_ROOT/libs/http_proto" ]; then
144+
pushd $BOOST_ROOT/libs
145+
git clone https://github.com/cppalliance/http_proto -b $BOOST_BRANCH --depth 1
146+
popd
147+
fi
148+
149+
if [ ! -d "$BOOST_ROOT/libs/http_proto" ]; then
150+
pushd $BOOST_ROOT/libs
151+
git clone https://github.com/cppalliance/ws_proto -b $BOOST_BRANCH --depth 1
152+
popd
153+
fi
154+
155+
cd libs/$SELF
156+
mkdir __build__ && cd __build__
157+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
158+
cmake --build . --target install
159+
160+
elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then
161+
162+
echo '==================================> INSTALL'
163+
164+
common_install
165+
166+
echo '==================================> COMPILE'
167+
168+
# Warnings as errors -Werror not building. Remove for now:
169+
# export CXXFLAGS="-Wall -Wextra -Werror"
170+
export CXXFLAGS="-Wall -Wextra"
171+
export CMAKE_OPTIONS=${CMAKE_OPTIONS:--DBUILD_TESTING=ON}
172+
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}
173+
174+
mkdir __build_static
175+
cd __build_static
176+
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
177+
-DBOOST_INCLUDE_LIBRARIES=$SELF ..
178+
cmake --build .
179+
ctest --output-on-failure -R boost_$SELF
180+
181+
cd ..
182+
183+
if [ "$CMAKE_SHARED_LIBS" = 1 ]; then
184+
185+
mkdir __build_shared
186+
cd __build_shared
187+
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
188+
-DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON ..
189+
cmake --build .
190+
ctest --output-on-failure -R boost_$SELF
191+
192+
fi
193+
194+
fi

0 commit comments

Comments
 (0)