diff --git a/.circleci/config.yml b/.circleci/config.yml index e9447fc62..923474f84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,9 @@ jobs: command: sudo apt-get update - run: name: Install dependencies - command: sudo apt-get install -y cmake libqt5svg5 libqt5svg5-dev neovim python3-dev python3-jinja2 python3-msgpack python3-pip qt5-default + command: | + sudo apt-get install -y cmake libqt5svg5 libqt5svg5-dev neovim python3-dev python3-jinja2 python3-msgpack python3-pip qt5-default + pip install --user cpp-coveralls PyYAML - run: name: build command: | @@ -29,4 +31,9 @@ jobs: command: | cd build ctest -VV + - run: + name: Upload coverage report + # trick cpp-coveralls into doing the right thing + # https://github.com/eddyxu/cpp-coveralls/issues/143 + command: TRAVIS_JOB_ID="#${CIRCLE_BUILD_NUM}" ~/.local/bin/cpp-coveralls -y contrib/coveralls-circle.yml -E '.*/build/.*' -E '.*/third-party/.*' -E '.*/test/.*' -E '.*/bindings/.*' diff --git a/.travis.yml b/.travis.yml index 3b1c5e74f..9346d57ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,16 @@ before_install: - brew ls | grep -wq cmake || brew install cmake - brew ls | grep -wq qt5 || brew install qt5 - brew ls | grep -wq msgpack || brew install msgpack + # cpp-coveralls https://github.com/eddyxu/cpp-coveralls + - pip install cpp-coveralls PyYAML script: - mkdir build - cd build - - cmake -DUSE_SYSTEM_MSGPACK=OFF .. + - cmake -DUSE_SYSTEM_MSGPACK=OFF -DUSE_GCOV=ON .. - make - nvim --version - ctest --output-on-failure +#after_success: +# # collect coverage +# - cd $TRAVIS_BUILD_DIR +# - coveralls -y contrib/coveralls-travis.yml -E '.*/build/.*' -E '.*/third-party/.*' -E '.*/test/.*' -E '.*/bindings/.*' diff --git a/contrib/coveralls-circle.yml b/contrib/coveralls-circle.yml new file mode 100644 index 000000000..4bec845a3 --- /dev/null +++ b/contrib/coveralls-circle.yml @@ -0,0 +1,8 @@ +gcov_options: '\-lp' +root: '.' +build_root: 'build' +service_name: 'circle-ci' +# Do not set exclude rules as they skip running gcov entirely +# which is too broad https://github.com/eddyxu/cpp-coveralls/issues/145#issuecomment-521623753 +# instead check the travis recipe for post filters +#exclude: ['test', 'build', 'third-party'] diff --git a/contrib/coveralls-travis.yml b/contrib/coveralls-travis.yml new file mode 100644 index 000000000..e4848b29f --- /dev/null +++ b/contrib/coveralls-travis.yml @@ -0,0 +1,8 @@ +gcov_options: '\-lp' +root: '.' +build_root: 'build' +service_name: 'travis-ci' +# Do not set exclude rules as they skip running gcov entirely +# which is too broad https://github.com/eddyxu/cpp-coveralls/issues/145#issuecomment-521623753 +# instead check the travis recipe for post filters +#exclude: ['test', 'build', 'third-party']