update to new-style boost-ci scripting

This commit is contained in:
James E. King III
2018-05-29 02:12:39 +00:00
parent 4a83ca8a57
commit e91b39f94f
8 changed files with 37 additions and 245 deletions

View File

@ -1,3 +0,0 @@
fixes:
- home/travis/build/*/boost-root/boost/::include/boost/
- home/travis/build/*/boost-root/libs/*/src/::src/

View File

@ -8,20 +8,17 @@
#
# Instructions for customizing this script for your library:
#
# 1. Copy the ci/ directory from the same source into your project:
# ci/build.sh runs the build
# ci/codecov.sh is used to run a profiling build and upload results to codecov.io
# ci/coverity.sh is used to run a coverity build and upload results to coverity scan
# 2. Customize the compilers and language levels you want. Default is C++03.
# 3. Update the global B2 environment settings to your liking.
# 4. If you have more than include/, src/, and test/ directories then
# add them to the depinst.py line as "--include tools" for tools/ (you
# can put multiple --include on the command line).
# 5. If you want to enable Coverity Scan, you need to provide the environment
# 1. Customize the compilers and language levels you want.
# 2. If you have move than include/, src/, test/, example/, examples/, or
# tools/ directories, modify your Travis CI project and add the environment
# variable DEPINST. For example if your build uses code in "bench/" and
# "fog/" directories, then set DEPINST to the following:
# --include bench --include fog
# 3. If you want to enable Coverity Scan, you need to provide the environment
# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
# your github settings.
# 6. Enable pull request builds in your boostorg/<library> account.
# 7. Change the default C++ version in ci/*.sh (search for CXXSTD)
# 4. Enable pull request builds in your boostorg/<library> account.
# 5. Change the default C++ version in ci/travis/*.sh (search for CXXSTD) if needed.
#
# That's it - the scripts will do everything else for you.
@ -39,19 +36,9 @@ env:
- B2_VARIANT=variant=release,debug
install:
- export SELF=`basename $TRAVIS_BUILD_DIR`
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update -q --init tools/boostdep
- git submodule update -q --init tools/build
- git submodule update -q --init tools/inspect
- cp -r $TRAVIS_BUILD_DIR/* libs/$SELF
- export BOOST_ROOT="`pwd`"
- export PATH="`pwd`":$PATH
- python tools/boostdep/depinst/depinst.py $SELF
- ./bootstrap.sh
- ./b2 headers
- git clone https://github.com/jeking3/boost-ci.git boost-ci
- cp -pr boost-ci/ci boost-ci/.codecov.yml .
- source ci/travis/install.sh
addons:
apt:
@ -66,8 +53,8 @@ branches:
- master
script:
- cd libs/$SELF
- ci/build.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/build.sh
jobs:
include:
@ -114,7 +101,8 @@ jobs:
env:
- COMMENT=cppcheck
script:
- libs/$SELF/ci/cppcheck.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/cppcheck.sh
- os: linux
env:
@ -144,14 +132,17 @@ jobs:
- ubuntu-toolchain-r-test
script:
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && cd lcov && sudo make install && which lcov && lcov --version && popd
- cd libs/$SELF
- ci/codecov.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/codecov.sh
- os: osx
osx_image: xcode9
env:
- TOOLSET=clang
- CXXSTD=03,11
# does not work with sources install shell yet: see
# https://travis-ci.org/jeking3/tokenizer/jobs/384903189
# for a typical failure
# - os: osx
# osx_image: xcode9
# env:
# - TOOLSET=clang
# - CXXSTD=03,11
#################### Jobs to run on pushes to master, develop ###################
@ -163,8 +154,8 @@ jobs:
- TOOLSET=gcc
script:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- cd libs/$SELF
- ci/coverity.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/coverity.sh
notifications:
email:

View File

@ -45,6 +45,7 @@ environment:
B2_ADDRESS_MODEL: address-model=32
# https://github.com/boostorg/test/issues/144
DEFINES: define=_POSIX_C_SOURCE=200112L
THREADING: threadapi=pthread
TOOLSET: gcc
- FLAVOR: cygwin (64-bit)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
@ -52,34 +53,29 @@ environment:
B2_ADDRESS_MODEL: address-model=64
# https://github.com/boostorg/test/issues/144
DEFINES: define=_POSIX_C_SOURCE=200112L
THREADING: threadapi=pthread
TOOLSET: gcc
- FLAVOR: mingw32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARCH: i686
B2_ADDRESS_MODEL: address-model=32
SCRIPT: ci\mingw.bat
SCRIPT: ci\appveyor\mingw.bat
- FLAVOR: mingw64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARCH: x86_64
B2_ADDRESS_MODEL: address-model=64
SCRIPT: ci\mingw.bat
SCRIPT: ci\appveyor\mingw.bat
install:
- set SELF=%APPVEYOR_PROJECT_SLUG:-=_%
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update -q --init tools/boostdep
- git submodule update -q --init tools/build
- git submodule update -q --init tools/inspect
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\%SELF%
- python tools/boostdep/depinst/depinst.py --include example --include tools %SELF%
- cmd /c bootstrap
- b2 headers
- git clone https://github.com/jeking3/boost-ci.git C:\boost-ci
- xcopy /s /e /q /i C:\boost-ci\ci .\ci
- ci\appveyor\install.bat
build: off
test_script:
- set SELF=%APPVEYOR_PROJECT_SLUG:-=_%
- PATH=%ADDPATH%%PATH%
- IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF% toolset=%TOOLSET% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
- IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF% toolset=%TOOLSET% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)

View File

@ -1,19 +0,0 @@
#! /bin/bash
#
# Copyright 2017 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Bash script to run in travis to perform a bjam build
# cwd should be $BOOST_ROOT/libs/$SELF before running
#
set -ex
# default language level: c++03
if [[ -z "$CXXSTD" ]]; then
CXXSTD=03
fi
$BOOST_ROOT/b2 . toolset=$TOOLSET cxxstd=$CXXSTD $CXXFLAGS $DEFINES $LINKFLAGS $TESTFLAGS $B2_ADDRESS_MODEL $B2_LINK $B2_THREADING $B2_VARIANT -j3 $*

View File

@ -1,43 +0,0 @@
#! /bin/bash
#
# Copyright 2017, 2018 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Bash script to run in travis to perform codecov.io integration
#
###
### NOTE: Make sure you grab .codecov.yml
###
# assumes cwd is the top level directory of the boost project
# assumes an environment variable $SELF is the boost project name
set -ex
B2_VARIANT=debug
ci/build.sh cxxflags=-fprofile-arcs cxxflags=-ftest-coverage linkflags=-fprofile-arcs linkflags=-ftest-coverage
# switch back to the original source code directory
cd $TRAVIS_BUILD_DIR
# get the version of lcov
lcov --version
# coverage files are in ../../b2 from this location
lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --base-directory "$BOOST_ROOT/libs/$SELF" --directory "$BOOST_ROOT" --capture --output-file all.info
# all.info contains all the coverage info for all projects - limit to ours
lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --extract all.info "*/boost/$SELF/*" "*/libs/$SELF/src/*" --output-file coverage.info
# dump a summary on the console - helps us identify problems in pathing
lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --list coverage.info
#
# upload to codecov.io
#
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -f coverage.info -X gcov -x "gcov-7"

View File

@ -1,42 +0,0 @@
#! /bin/bash
#
# Copyright 2017 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Bash script to run in travis to perform a Coverity Scan build
# To skip the coverity integration download (which is huge) if
# you already have it from a previous run, add --skipdownload
#
#
# Environment Variables
#
# COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify
# COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure)
# SELF - the boost libs directory name
set -ex
pushd /tmp
if [[ "$1" != "--skipdownload" ]]; then
rm -rf coverity_tool.tgz cov-analysis*
wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=boostorg/$SELF" -O coverity_tool.tgz
tar xzf coverity_tool.tgz
fi
COVBIN=$(echo $(pwd)/cov-analysis*/bin)
export PATH=$COVBIN:$PATH
popd
ci/build.sh clean
rm -rf cov-int/
cov-build --dir cov-int ci/build.sh
tar cJf cov-int.tar.xz cov-int/
curl --form token="$COVERITY_SCAN_TOKEN" \
--form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \
--form file=@cov-int.tar.xz \
--form version="$(git describe --tags)" \
--form description="boostorg/$SELF" \
https://scan.coverity.com/builds?project="boostorg/$SELF"

View File

@ -1,38 +0,0 @@
#! /bin/bash
#
# Copyright 2018 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Bash script to run in travis to perform a cppcheck
# cwd should be $BOOST_ROOT before running
#
set -ex
# default language level: c++03
if [[ -z "$CXXSTD" ]]; then
CXXSTD=03
fi
# Travis' ubuntu-trusty comes with cppcheck 1.62 which is pretty old
# default cppcheck version: 1.82
if [[ -z "$CPPCHKVER" ]]; then
CPPCHKVER=1.82
fi
pushd ~
wget https://github.com/danmar/cppcheck/archive/$CPPCHKVER.tar.gz
tar xzf $CPPCHKVER.tar.gz
mkdir cppcheck-build
cd cppcheck-build
cmake ../cppcheck-$CPPCHKVER -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/cppcheck
make -j3 install
popd
~/cppcheck/bin/cppcheck -I. --std=c++$CXXSTD --enable=all --error-exitcode=1 \
--force --check-config --suppress=*:boost/preprocessor/tuple/size.hpp \
-UBOOST_USER_CONFIG -UBOOST_COMPILER_CONFIG -UBOOST_STDLIB_CONFIG -UBOOST_PLATFORM_CONFIG \
libs/$SELF 2>&1 | grep -v 'Cppcheck does not need standard library headers'

View File

@ -1,50 +0,0 @@
::
:: MinGW Build Script for Appveyor, leveraging the MSYS2 installation
:: Copyright (C) 2018 James E. King III
:: Distributed under the Boost Software License, Version 1.0.
:: (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
::
@ECHO ON
SETLOCAL EnableDelayedExpansion
:: Set up the toolset
echo using gcc : %FLAVOR% : %ARCH%-w64-mingw32-g++.exe ; > %USERPROFILE%\user-config.jam
SET UPPERFLAVOR=%FLAVOR%
CALL :TOUPPER UPPERFLAVOR
:: Install packages needed to build boost
:: Optional: comment out ones this library does not need,
:: so people can copy this script to another library.
FOR %%a IN ("gcc" "icu" "libiconv" "openssl" "xz" "zlib") DO (
c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
"pacman --sync --needed --noconfirm %FLAVOR%/mingw-w64-%ARCH%-%%a" || EXIT /B
)
c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
"pacman --sync --needed --noconfirm python3" || EXIT /B
::
:: Now build things...
::
c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
"cd %CD:\=/% && ./bootstrap.sh --with-toolset=gcc" || EXIT /B
c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
"cd %CD:\=/% && ./b2 libs/%SELF% toolset=gcc-%FLAVOR% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3" || EXIT /B
EXIT /B 0
::
:: Function to uppercase a variable
:: from: https://stackoverflow.com/questions/34713621/batch-converting-variable-to-uppercase
::
:TOUPPER <variable>
@ECHO OFF
FOR %%a IN ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I"
"j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R"
"s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z" ) DO ( CALL SET %~1=%%%~1:%%~a%% )
@ECHO ON
GOTO :EOF