forked from boostorg/geometry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[geometry] Add CircleCI and Coveralls integration, add icons to the R…
…EADME.
- Loading branch information
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Use, modification, and distribution are | ||
# subject to 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) | ||
# | ||
# Copyright Antony Polukhin 2014. | ||
# Copyright Adam Wulkiewicz 2015. | ||
|
||
machine: | ||
environment: | ||
BOOST_ROOT: boost-local | ||
COVERAGE_DIR: $CIRCLE_ARTIFACTS | ||
#COVERAGE_DIR: coverage | ||
|
||
dependencies: | ||
pre: | ||
- mkdir $BOOST_ROOT | ||
# on CircleCI it's impossible to switch working dir with cd | ||
- cd $BOOST_ROOT && git init . | ||
- cd $BOOST_ROOT && git remote add --no-tags -t $CIRCLE_BRANCH origin https://github.com/boostorg/boost.git | ||
- cd $BOOST_ROOT && git fetch --depth=1 | ||
- cd $BOOST_ROOT && git checkout $CIRCLE_BRANCH | ||
- cd $BOOST_ROOT && git submodule update --init --merge | ||
- cd $BOOST_ROOT && git remote set-branches --add origin $CIRCLE_BRANCH | ||
- cd $BOOST_ROOT && git pull --recurse-submodules | ||
- cd $BOOST_ROOT && git submodule update --init | ||
- cd $BOOST_ROOT && git checkout $CIRCLE_BRANCH | ||
- cd $BOOST_ROOT && git submodule foreach "git reset --quiet --hard; git clean -fxd" | ||
- cd $BOOST_ROOT && git reset --hard; git clean -fxd | ||
- cd $BOOST_ROOT && git status | ||
- cd $BOOST_ROOT && rm -rf libs/geometry/ | ||
- mkdir $BOOST_ROOT/libs/geometry | ||
- cp -R `ls -A | grep -v $BOOST_ROOT` $BOOST_ROOT/libs/geometry/ | ||
- cd $BOOST_ROOT && ./bootstrap.sh | ||
- cd $BOOST_ROOT && ./b2 headers | ||
|
||
test: | ||
override: | ||
# `--coverage` flags required to generate coverage info for Coveralls | ||
# temporary for test purposes | ||
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test/algorithms/detail | ||
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test | ||
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" index/test/algorithms | ||
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" index/test/rtree/exceptions | ||
post: | ||
## Copying Coveralls data to a separate folder | ||
- find $BOOST_ROOT/bin.v2/ -name "*.gcda" -exec cp "{}" $COVERAGE_DIR \; | ||
- find $BOOST_ROOT/bin.v2/ -name "*.gcno" -exec cp "{}" $COVERAGE_DIR \; | ||
|
||
## Preparing Coveralls data by | ||
## ... installing the tools | ||
- sudo apt-get install -qq python-yaml lcov | ||
|
||
# TEST | ||
- find $BOOST_ROOT/bin.v2/ \( -name "*.gcda" -o -name "*.gcno" \) -exec ls "{}" \; | ||
- find $BOOST_ROOT/bin.v2/ -name "*.gcno" -execdir lcov --directory . --base-directory $BOOST_ROOT/libs/geometry --capture --output-file ./coverage.info \; | ||
|
||
## ... changind data format to a readable one | ||
- cd $BOOST_ROOT/libs/geometry && lcov --directory $COVERAGE_DIR --base-directory ./ --capture --output-file $COVERAGE_DIR/coverage.info | ||
|
||
## ... erasing /test/ /example/ folder data | ||
- lcov --remove $COVERAGE_DIR/coverage.info "/usr*" -o $COVERAGE_DIR/coverage.info | ||
- lcov --remove $COVERAGE_DIR/coverage.info "*/geometry/test/*" "*/geometry/example/*" "*/geometry/*/test/*" "*/geometry/*/example/*" -o $COVERAGE_DIR/coverage.info | ||
|
||
## ... erasing data that is not related to this project directly | ||
# method 1 - doesn't work on CircleCI, and not all directories are filtered | ||
#- grep "submodule .*" $BOOST_ROOT/.gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/geometry\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g' | ||
#- lcov --remove $COVERAGE_DIR/coverage.info `grep "submodule .*" $BOOST_ROOT/.gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/geometry\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'` -o $COVERAGE_DIR/coverage.info | ||
|
||
## ... method 2.1 - doesn't work on CircleCI | ||
#- ls $BOOST_ROOT/boost | sed -r '/(geometry.*)/d' | sed -r 's/(.+)/"*\/boost\/\1\/*"/g' | sed -r 's/(.+\.hpp)\/\*/\1/g' | sed ':a;N;$!ba;s/\n/ /g' | ||
#- lcov --remove $COVERAGE_DIR/coverage.info `ls $BOOST_ROOT/boost | sed -r '/(geometry.*)/d' | sed -r 's/(.+)/"*\/boost\/\1\/*"/g' | sed -r 's/(.+\.hpp)\/\*/\1/g' | sed ':a;N;$!ba;s/\n/ /g'` -o $COVERAGE_DIR/coverage.info | ||
## ... method 2.2 - doesn't work on CircleCI | ||
#- ls $BOOST_ROOT/boost | sed -r '/(geometry.*)/d' | sed -r 's/(.+)/"*\/boost\/\1\/*"/g' | sed -r 's/(.+\.hpp)\/\*/\1/g' | sed ':a;N;$!ba;s/\n/ /g' > $COVERAGE_DIR/other_libs.txt | ||
#- lcov --remove $COVERAGE_DIR/coverage.info `cat $COVERAGE_DIR/other_libs.txt` -o $COVERAGE_DIR/coverage.info | ||
|
||
## ... method 3 | ||
- ls $BOOST_ROOT/boost | sed -r '/(geometry.*)/d' | sed -r 's/(.+)/"*\/boost\/\1\/*"/g' | sed -r 's/(.+\.hpp)\/\*/\1/g' | sed ':a;N;$!ba;s/\n/ /g' | xargs lcov --remove $COVERAGE_DIR/coverage.info -o $COVERAGE_DIR/coverage.info | ||
|
||
## ... sanity check | ||
- ls -lah $COVERAGE_DIR | ||
|
||
## Sending data to Coveralls | ||
- gem install coveralls-lcov | ||
|
||
## ... convert data with coveralls-lcov | ||
# used only for test purposes | ||
- coveralls-lcov -v -n $COVERAGE_DIR/coverage.info > $COVERAGE_DIR/coverage.json | ||
|
||
## ... send | ||
- coveralls-lcov --repo-token=$COVERALLS_REPO_TOKEN $COVERAGE_DIR/coverage.info |