diff --git a/.travis.yml b/.travis.yml index c870aeb054..1390c238d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,12 @@ matrix: sudo: required services: - docker - env: BUILD_TARGET=tests_linux + env: BUILD_TARGET=tests + - os: linux + sudo: required + services: + - docker + env: BUILD_TARGET=tests_coverage - os: linux sudo: required services: @@ -55,8 +60,10 @@ script: echo "no script for coverity build"; elif [[ "${BUILD_TARGET}" = "check_format" ]]; then ./Tools/docker_run.sh 'make check_format'; - elif [[ "${BUILD_TARGET}" = "tests_linux" ]]; then + elif [[ "${BUILD_TARGET}" = "tests" ]]; then ./Tools/docker_run.sh 'make tests'; + elif [[ "${BUILD_TARGET}" = "tests_coverage" ]]; then + ./Tools/docker_run.sh 'make tests_coverage'; elif [[ "${BUILD_TARGET}" = "px4_metadata" ]]; then ./Tools/docker_run.sh 'make px4_metadata'; elif [[ "${BUILD_TARGET}" = "clang-tidy" ]]; then @@ -74,6 +81,10 @@ after_success: - if [[ "${BUILD_TARGET}" = "scan-build" && "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" ]]; then PX4_DOCKER_REPO=px4io/px4-dev-clang:2017-04-22 ./Tools/docker_run.sh 'make s3put_scan-build AWS_S3_BUCKET="px4-travis/scan-build"'; fi + # coveralls code coverage report + - if [[ "${BUILD_TARGET}" = "tests_coverage" && "${TRAVIS_PULL_REQUEST}" == "false" ]]; then + ./Tools/docker_run.sh 'cpp-coveralls -l coverage.info'; + fi addons: coverity_scan: diff --git a/Tools/docker_run.sh b/Tools/docker_run.sh index 2ec1da8021..046bc6943a 100755 --- a/Tools/docker_run.sh +++ b/Tools/docker_run.sh @@ -46,6 +46,7 @@ docker run -it --rm -w "${SRC_DIR}" \ -e BRANCH_NAME="${BRANCH_NAME}" \ -e CCACHE_DIR="${CCACHE_DIR}" \ -e CI="${CI}" \ + -e COVERALLS_REPO_TOKEN="${COVERALLS_REPO_TOKEN}" \ -e DISPLAY="${DISPLAY}" \ -e GIT_SUBMODULES_ARE_EVIL=1 \ -e LOCAL_USER_ID="$(id -u)" \