Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drone config #108

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.

# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1804:1"
windowsglobalimage="cppalliance/dronevs2019"

def main(ctx):
return [
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=11 Job 0", "g++-7", packages="g++-7 g++-9 clang-7 clang-10 libopenblas-base rpm2cpio cpio clinfo opencl-headers ocl-icd-opencl-dev", llvm_os="bionic", llvm_ver="10", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '11', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=17 Job 1", "g++-7", packages="g++-7 g++-9 clang-7 clang-10 libopenblas-base rpm2cpio cpio clinfo opencl-headers ocl-icd-opencl-dev", llvm_os="bionic", llvm_ver="10", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '17', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-9 CXXSTD=2a Job 2", "g++-9", packages="g++-7 g++-9 clang-7 clang-10 libopenblas-base rpm2cpio cpio clinfo opencl-headers ocl-icd-opencl-dev", llvm_os="bionic", llvm_ver="10", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '2a', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-7 CXXSTD=17 Job 3", "clang++-7", packages="g++-7 g++-9 clang-7 clang-10 libopenblas-base rpm2cpio cpio clinfo opencl-headers ocl-icd-opencl-dev", llvm_os="bionic", llvm_ver="10", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '17', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-10 CXXSTD=2a Job 4", "clang++-10", packages="g++-7 g++-9 clang-7 clang-10 libopenblas-base rpm2cpio cpio clinfo opencl-headers ocl-icd-opencl-dev", llvm_os="bionic", llvm_ver="10", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '2a', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
]

# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
17 changes: 17 additions & 0 deletions .drone/before-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/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)

if [ "$DRONE_JOB_UUID" = "b6589fc6ab" ] || [ "$DRONE_JOB_UUID" = "356a192b79" ] || [ "$DRONE_JOB_UUID" = "da4b9237ba" ] || [ "$DRONE_JOB_UUID" = "77de68daec" ] || [ "$DRONE_JOB_UUID" = "1b64538924" ] ; then
export CLBLAS_PREFIX="${TRAVIS_BUILD_DIR}/CLBLAS/"
export PATH="${CLBLAS_PREFIX}/bin:$PATH"
export LD_LIBRARY_PATH="${CLBLAS_PREFIX}/lib:$LD_LIBRARY_PATH"
if [ ${TRAVIS_OS_NAME} == "linux" ]; then .ci/install-ocl-ubuntu.sh; fi
.ci/install-clblas.sh
cmake --version;
true ${CC} --version;
${CXX} --version;
fi

46 changes: 46 additions & 0 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/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 -e
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export REPO_NAME=$DRONE_REPO
export PATH=~/.local/bin:/usr/local/bin:$PATH

if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then

echo '==================================> BEFORE_INSTALL'

. .drone/before-install.sh

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

cd ..
git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 8 tools/build
git submodule update --init --jobs 8 libs/config
git submodule update --init --jobs 8 tools/boostdep
mkdir -p libs/numeric/
cp -rp $TRAVIS_BUILD_DIR/. libs/numeric/ublas
python tools/boostdep/depinst/depinst.py -I benchmarks numeric/ublas
./bootstrap.sh
./b2 -j 8 headers
export BOOST_ROOT="`pwd`"

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

echo "using $TOOLSET : : $COMPILER ;" >> ~/user-config.jam;
echo "using clblas : : <include>${CLBLAS_PREFIX}/include <search>${CLBLAS_PREFIX}/lib ;" >> ~/user-config.jam;
cp $TRAVIS_BUILD_DIR/opencl.jam ~/
cp $TRAVIS_BUILD_DIR/clblas.jam ~/
cd libs/numeric/ublas
$BOOST_ROOT/b2 -j 8 test toolset=$TOOLSET cxxstd=$CXXSTD

fi