• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1version: 2
2
3jobs:
4  build:
5    environment:
6      - BOOST_LIBRARY=process
7      - CXX_STANDARD=gnu++11
8    docker:
9      - image: gcc:7
10    steps:
11      - checkout
12      - run:
13          name: Setting up Environment
14          command: |
15            echo 'export BOOST="$HOME/boost-local"' >> $BASH_ENV
16            if [ $CIRCLE_BRANCH = "master" ]; then
17                echo 'export BOOST_BRANCH="master"' >> $BASH_ENV;
18            else
19                echo 'export BOOST_BRANCH="develop"' >> $BASH_ENV;
20            fi
21            echo 'export BOOST_REMOVE="$BOOST/libs/$BOOST_LIBRARY"' >> $BASH_ENV
22            HOME_SED_=$(echo $HOME | sed -e 's/\//\\\//g')
23            echo 'export HOME_SED=$HOME_SED_' >> $BASH_ENV
24      - run:
25          name: install pre dependencies
26          command: |
27            apt-get update -yqq
28            apt-get install git curl valgrind -y
29      - run:
30          name: Initializing git repo for boost
31          command: |
32            git init $BOOST
33            cd $BOOST
34            echo Testing $BRANCH_TO_TEST
35            git remote add --no-tags -t $BOOST_BRANCH origin https://github.com/boostorg/boost.git
36            git fetch --depth=1
37            git checkout $BOOST_BRANCH
38            git submodule update --init --merge
39            git remote set-branches --add origin $BOOST_BRANCH
40            git pull --recurse-submodules
41            git submodule update --init
42            git checkout $BOOST_BRANCH
43            git submodule foreach "git reset --quiet --hard; git clean -fxd"
44            git reset --hard; git clean -fxd
45            git status
46            rm -rf $BOOST_REMOVE
47            mv $HOME/project $BOOST_REMOVE
48      - run:
49          name: Bootstrapping boost-build
50          command: |
51            cd $BOOST
52            ./bootstrap.sh
53            ./b2 headers
54      - run:
55          name: Building examples
56          command: |
57            cd $BOOST_REMOVE/example
58            ../../../b2 -j2 address-model=64 architecture=x86 toolset=gcc cxxflags="-std=gnu++14" -sBOOST_BUILD_PATH=. | tee example.log || FAILED=1
59            sed -i -e "s/^..\/..\/..\/boost\/process\//\/root\/project\/include\/boost\/process\//gm" example.log
60            python <(curl -s https://report.ci/annotate.py) --tool gcc --name "Circle CI Gcc Build" --input example.log
61            exit $FAILED
62      - run:
63          name: Running Unit tests
64          command: |
65            cd $BOOST_REMOVE/test
66            ../../../b2 -j2 with-valgrind address-model=64 architecture=x86 testing.launcher=valgrind valgrind=on toolset=gcc cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage" -sBOOST_BUILD_PATH=. | tee test.log || FAILED=1
67            ../../../b2 -j2 without-valgrind address-model=64 architecture=x86 toolset=gcc cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage" -sBOOST_BUILD_PATH=. | tee no-valgrind.log || FAILED=1
68            sed -i -e "s/^..\/..\/..\/boost\/process\//\/root\/project\/include\/boost\/process\//gm" test.log
69            sed -i -e "s/^..\/..\/..\/boost\/process\//\/root\/project\/include\/boost\/process\//gm" no-valgrind.log
70
71            python <(curl -s https://report.ci/annotate.py) --tool gcc --input test.log
72            python <(curl -s https://report.ci/annotate.py) --tool gcc --input no-valgrind.log
73            bash <(curl -s https://codecov.io/bash) -x gcov > /dev/null || true
74            echo "BUILD_RESULT: $FAILED"
75            exit $FAILED
76