diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-02-07 09:27:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 09:27:51 +0100 |
commit | adae075fcffe0b5d1a790c41c083b78db27ba80b (patch) | |
tree | 434dc49e3eeb07a510117b52ab6e8696b4405808 | |
parent | 1391385ba9f83d32f3b6fc54587f03a1d34960d9 (diff) | |
download | rneovim-adae075fcffe0b5d1a790c41c083b78db27ba80b.tar.gz rneovim-adae075fcffe0b5d1a790c41c083b78db27ba80b.tar.bz2 rneovim-adae075fcffe0b5d1a790c41c083b78db27ba80b.zip |
ci: remove unnecessary variables and functions (#22150)
-rwxr-xr-x | ci/before_cache.sh | 4 | ||||
-rwxr-xr-x | ci/before_script.sh | 30 | ||||
-rw-r--r-- | ci/common/build.sh | 58 | ||||
-rw-r--r-- | ci/common/suite.sh | 5 | ||||
-rw-r--r-- | ci/common/test.sh | 3 | ||||
-rwxr-xr-x | ci/run_tests.sh | 31 |
6 files changed, 51 insertions, 80 deletions
diff --git a/ci/before_cache.sh b/ci/before_cache.sh index 3daeb04793..d7405bab19 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -5,8 +5,6 @@ set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # shellcheck source-path=SCRIPTDIR -source "${CI_DIR}/common/build.sh" -# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/suite.sh" mkdir -p "${HOME}/.cache" @@ -22,5 +20,5 @@ if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}" touch "${CACHE_MARKER}" - echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))." + echo "Updated third-party dependencies." fi diff --git a/ci/before_script.sh b/ci/before_script.sh index 066789af36..4a95e5a60f 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -3,22 +3,34 @@ set -e set -o pipefail -CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source-path=SCRIPTDIR -source "${CI_DIR}/common/build.sh" - # Test some of the configuration variables. if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then echo "\$GCOV: '${GCOV}' is not executable." exit 1 fi -if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; then - echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable." - exit 1 + +if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then + DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" +fi + +mkdir -p "${DEPS_BUILD_DIR}" + +# Use cached dependencies if $CACHE_MARKER exists. +if test -f "${CACHE_MARKER}"; then + echo "Using third-party dependencies from cache." + cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}" fi -# Compile dependencies. -build_deps +# 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}'." +# shellcheck disable=SC2086 +cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" + +ninja || exit 1 + +cd "${CI_BUILD_DIR}" # Install cluacov for Lua coverage. if [[ "$USE_LUACOV" == 1 ]]; then diff --git a/ci/common/build.sh b/ci/common/build.sh deleted file mode 100644 index b1ea2270c0..0000000000 --- a/ci/common/build.sh +++ /dev/null @@ -1,58 +0,0 @@ -_stat() { - if test "${CI_OS_NAME}" = osx ; then - stat -f %Sm "${@}" - else - stat -c %y "${@}" - fi -} - -build_deps() { - if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then - DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" - fi - - mkdir -p "${DEPS_BUILD_DIR}" - - # Use cached dependencies if $CACHE_MARKER exists. - if test -f "${CACHE_MARKER}"; then - echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))." - cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_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}'." - # shellcheck disable=SC2086 - CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" - - ninja || exit 1 - - cd "${CI_BUILD_DIR}" -} - -build_nvim() { - check_core_dumps --delete quiet - - if test -n "${CLANG_SANITIZER}" ; then - CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" - fi - - mkdir -p "${BUILD_DIR}" - cd "${BUILD_DIR}" - echo "Configuring with '${CMAKE_FLAGS} $*'." - # shellcheck disable=SC2086 - cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" - - echo "Building nvim." - ninja nvim || exit 1 - - # Invoke nvim to trigger *San early. - if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then - check_sanitizer "${LOG_DIR}" - exit 1 - fi - check_sanitizer "${LOG_DIR}" - - cd "${CI_BUILD_DIR}" -} diff --git a/ci/common/suite.sh b/ci/common/suite.sh index c81261d2e7..9c3056baaf 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -34,8 +34,3 @@ ended_successfully() { fi return 0 } - -end_tests() { - touch "${END_MARKER}" - ended_successfully -} diff --git a/ci/common/test.sh b/ci/common/test.sh index 03d85067be..c3b8d45b9f 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -1,4 +1,3 @@ -. "${CI_DIR}/common/build.sh" . "${CI_DIR}/common/suite.sh" submit_coverage() { @@ -84,7 +83,7 @@ valgrind_check() { check_sanitizer() { if test -n "${CLANG_SANITIZER}"; then - check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat} + check_logs "${1}" "*san.*" | cat fi } diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 0ef7080628..c692d859d7 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -5,12 +5,36 @@ set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # shellcheck source-path=SCRIPTDIR -source "${CI_DIR}/common/build.sh" -# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/test.sh" # shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/suite.sh" +build_nvim() { + check_core_dumps --delete quiet + + if test -n "${CLANG_SANITIZER}" ; then + CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" + fi + + mkdir -p "${BUILD_DIR}" + cd "${BUILD_DIR}" + echo "Configuring with '${CMAKE_FLAGS} $*'." + # shellcheck disable=SC2086 + cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" + + echo "Building nvim." + ninja nvim || exit 1 + + # Invoke nvim to trigger *San early. + if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then + check_sanitizer "${LOG_DIR}" + exit 1 + fi + check_sanitizer "${LOG_DIR}" + + cd "${CI_BUILD_DIR}" +} + rm -f "$END_MARKER" # Run all tests (with some caveats) if no input argument is given @@ -34,7 +58,8 @@ for i in "${tests[@]}"; do eval "$i" || fail "$i" done -end_tests +touch "${END_MARKER}" +ended_successfully if [[ -s "${GCOV_ERROR_FILE}" ]]; then echo '=== Unexpected gcov errors: ===' |