aboutsummaryrefslogtreecommitdiff
path: root/ci/common
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-03-28 21:52:06 -0400
committerJames McCoy <jamessan@jamessan.com>2018-03-28 21:54:39 -0400
commit79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1 (patch)
tree4e0589d75801f3ff6a9678f84f5009102766661e /ci/common
parent4403864da3c48412595d439f36458d1e6ccfc49f (diff)
parent3f3de9b1a95d273463a87516365510dbffcaf3d2 (diff)
downloadrneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.tar.gz
rneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.tar.bz2
rneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.zip
Merge branch 'master' into yagebu/option-fixes
Diffstat (limited to 'ci/common')
-rw-r--r--ci/common/build.sh55
-rw-r--r--ci/common/test.sh16
2 files changed, 50 insertions, 21 deletions
diff --git a/ci/common/build.sh b/ci/common/build.sh
index f398a1a1cc..80973b64c9 100644
--- a/ci/common/build.sh
+++ b/ci/common/build.sh
@@ -1,5 +1,16 @@
+_stat() {
+ if test "${TRAVIS_OS_NAME}" = osx ; then
+ stat -f %Sm "${@}"
+ else
+ stat -c %y "${@}"
+ fi
+}
+
top_make() {
- ${MAKE_CMD} "$@"
+ echo '================================================================================'
+ # Travis has 1.5 virtual cores according to:
+ # http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
+ ninja "$@"
}
build_make() {
@@ -15,28 +26,21 @@ build_deps() {
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
- rm -rf "${DEPS_BUILD_DIR}"
-
- # If there is a valid cache and we're not forced to recompile,
- # use cached third-party dependencies.
- if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then
- local statcmd="stat -c '%y'"
- if test "${TRAVIS_OS_NAME}" = osx ; then
- statcmd="stat -f '%Sm'"
- fi
- echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
+ mkdir -p "${DEPS_BUILD_DIR}"
+ mkdir -p "${DEPS_DOWNLOAD_DIR}"
- mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
- mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
- else
- mkdir -p "${DEPS_BUILD_DIR}"
+ # Use cached dependencies if $CACHE_MARKER exists.
+ if test -f "${CACHE_MARKER}" && ! test "${CACHE_ENABLE}" = "false" ; then
+ echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
+ cp -r "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
+ cp -r "${HOME}/.cache/nvim-deps-downloads" "${DEPS_DOWNLOAD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to
# update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
- CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
+ CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
if ! top_make; then
exit 1
@@ -56,7 +60,7 @@ prepare_build() {
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'."
- cmake ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
+ cmake -G Ninja ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
}
build_nvim() {
@@ -71,9 +75,11 @@ build_nvim() {
exit 1
fi
- echo "Building nvim-test."
- if ! top_make nvim-test ; then
- exit 1
+ if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
+ echo "Building nvim-test."
+ if ! top_make nvim-test ; then
+ exit 1
+ fi
fi
fi
@@ -87,3 +93,12 @@ build_nvim() {
cd "${TRAVIS_BUILD_DIR}"
}
+
+macos_rvm_dance() {
+ # neovim-ruby gem requires a ruby newer than the macOS default.
+ source ~/.rvm/scripts/rvm
+ rvm get stable --auto-dotfiles
+ rvm reload
+ rvm use 2.2.5
+ rvm use
+}
diff --git a/ci/common/test.sh b/ci/common/test.sh
index 55f76ca798..bc80dfead7 100644
--- a/ci/common/test.sh
+++ b/ci/common/test.sh
@@ -1,6 +1,15 @@
. "${CI_DIR}/common/build.sh"
. "${CI_DIR}/common/suite.sh"
+submit_coverage() {
+ if [ -n "${GCOV}" ]; then
+ if curl --fail --output codecov.bash --silent https://codecov.io/bash; then
+ bash codecov.bash -c -F "$1" || echo "codecov upload failed."
+ rm -f codecov.bash
+ fi
+ fi
+}
+
print_core() {
local app="$1"
local core="$2"
@@ -71,7 +80,9 @@ valgrind_check() {
}
asan_check() {
- check_logs "${1}" "*san.*"
+ if test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
+ check_logs "${1}" "*san.*" | asan_symbolize
+ fi
}
run_unittests() {(
@@ -80,6 +91,7 @@ run_unittests() {(
if ! build_make unittest ; then
fail 'unittests' F 'Unit tests failed'
fi
+ submit_coverage unittest
check_core_dumps "$(which luajit)"
exit_suite
)}
@@ -90,6 +102,7 @@ run_functionaltests() {(
if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' F 'Functional tests failed'
fi
+ submit_coverage functionaltest
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
@@ -103,6 +116,7 @@ run_oldtests() {(
reset
fail 'oldtests' F 'Legacy tests failed'
fi
+ submit_coverage oldtest
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps