diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /ci | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/before_cache.sh | 26 | ||||
-rwxr-xr-x | ci/before_script.sh | 29 | ||||
-rw-r--r-- | ci/common/build.sh | 78 | ||||
-rwxr-xr-x | ci/common/submit_coverage.sh | 56 | ||||
-rw-r--r-- | ci/common/suite.sh | 41 | ||||
-rw-r--r-- | ci/common/test.sh | 175 | ||||
-rwxr-xr-x | ci/install.sh | 20 | ||||
-rwxr-xr-x | ci/run_tests.sh | 43 |
8 files changed, 0 insertions, 468 deletions
diff --git a/ci/before_cache.sh b/ci/before_cache.sh deleted file mode 100755 index 3daeb04793..0000000000 --- a/ci/before_cache.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -e -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" - -echo "before_cache.sh: cache size" -du -chd 1 "${HOME}/.cache" | sort -rh | head -20 - -# Update the third-party dependency cache only if the build was successful. -if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then - # Do not cache downloads. They should not be needed with up-to-date deps. - rm -rf "${DEPS_BUILD_DIR}/build/downloads" - rm -rf "${CACHE_NVIM_DEPS_DIR}" - mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}" - - touch "${CACHE_MARKER}" - echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))." -fi diff --git a/ci/before_script.sh b/ci/before_script.sh deleted file mode 100755 index 066789af36..0000000000 --- a/ci/before_script.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -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 -fi - -# Compile dependencies. -build_deps - -# Install cluacov for Lua coverage. -if [[ "$USE_LUACOV" == 1 ]]; then - "${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov -fi - -rm -rf "${LOG_DIR}" -mkdir -p "${LOG_DIR}" diff --git a/ci/common/build.sh b/ci/common/build.sh deleted file mode 100644 index 95972aab13..0000000000 --- a/ci/common/build.sh +++ /dev/null @@ -1,78 +0,0 @@ -_stat() { - if test "${CI_OS_NAME}" = osx ; then - stat -f %Sm "${@}" - else - stat -c %y "${@}" - fi -} - -top_make() { - printf '%78s\n' ' ' | tr ' ' '=' - ninja "$@" -} - -build_make() { - top_make -C "${BUILD_DIR}" "$@" -} - -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/" - - if ! top_make; then - exit 1 - fi - - 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." - if ! top_make nvim ; then - exit 1 - fi - - if test "$CLANG_SANITIZER" != "TSAN" ; then - echo "Building libnvim." - if ! top_make libnvim ; then - exit 1 - fi - fi - - # 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/submit_coverage.sh b/ci/common/submit_coverage.sh deleted file mode 100755 index f781ca8e5e..0000000000 --- a/ci/common/submit_coverage.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# Collect and submit coverage reports. -# -# Args: -# $1: Flag(s) for codecov, separated by comma. - -set -e - -# Change to grandparent dir (POSIXly). -CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit - -echo "=== running submit_coverage in $PWD: $* ===" -"$GCOV" --version - -# Download/install codecov-bash and gcovr once. -codecov_sh="${TEMP:-/tmp}/codecov.bash" -if ! [ -f "$codecov_sh" ]; then - curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash - chmod +x "$codecov_sh" - - python -m pip install --quiet --user gcovr -fi - -( - cd build - python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml -) - -# Upload to codecov. -# -X gcov: disable gcov, done manually above. -# -X fix: disable fixing of reports (not necessary, rather slow) -# -Z: exit non-zero on failure -# -F: flag(s) -# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then, -# which they know about for about a year already... -# Flags must match pattern ^[\w\,]+$ ("," as separator). -codecov_flags="$(uname -s),${1}" -codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g') -if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then - echo "codecov upload failed." -fi - -# Cleanup always, especially collected data. -find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l -rm -f coverage.xml - -# Upload Lua coverage (generated manually on AppVeyor/Windows). -if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then - if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then - "${DEPS_BUILD_DIR}/usr/bin/luacov" - fi - if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then - echo "codecov upload failed." - fi - rm luacov.stats.out -fi diff --git a/ci/common/suite.sh b/ci/common/suite.sh deleted file mode 100644 index c81261d2e7..0000000000 --- a/ci/common/suite.sh +++ /dev/null @@ -1,41 +0,0 @@ -# Test success marker. If END_MARKER file exists, we know that all tests -# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this -# file will contain information about failed tests. Build is considered -# successful if tests ended without any of them failing. -END_MARKER="$BUILD_DIR/.tests_finished" -FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" - -fail() { - local test_name="$1" - local message="$2" - - : "${message:=Test $test_name failed}" - - local full_msg="$test_name :: $message" - echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}" - echo "Failed: $full_msg" - export FAILED=1 -} - -ended_successfully() { - if test -f "${FAIL_SUMMARY_FILE}" ; then - echo 'Test failed, complete summary:' - cat "${FAIL_SUMMARY_FILE}" - - if [[ "$GITHUB_ACTIONS" == "true" ]]; then - rm -f "$FAIL_SUMMARY_FILE" - fi - - return 1 - fi - if ! test -f "${END_MARKER}" ; then - echo 'ended_successfully called before end marker was touched' - return 1 - fi - return 0 -} - -end_tests() { - touch "${END_MARKER}" - ended_successfully -} diff --git a/ci/common/test.sh b/ci/common/test.sh deleted file mode 100644 index 326ec162c3..0000000000 --- a/ci/common/test.sh +++ /dev/null @@ -1,175 +0,0 @@ -. "${CI_DIR}/common/build.sh" -. "${CI_DIR}/common/suite.sh" - -submit_coverage() { - if [ -n "${GCOV}" ]; then - "${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.' - fi -} - -print_core() { - local app="$1" - local core="$2" - if test "$app" = quiet ; then - echo "Found core $core" - return 0 - fi - echo "======= Core file $core =======" - if test "${CI_OS_NAME}" = osx ; then - lldb -Q -o "bt all" -f "${app}" -c "${core}" - else - gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" - fi -} - -check_core_dumps() { - local del= - if test "$1" = "--delete" ; then - del=1 - shift - fi - local app="${1:-${BUILD_DIR}/bin/nvim}" - local cores - if test "${CI_OS_NAME}" = osx ; then - cores="$(find /cores/ -type f -print)" - local _sudo='sudo' - else - cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)" - local _sudo= - fi - - if test -z "${cores}" ; then - return - fi - local core - for core in $cores; do - if test "$del" = "1" ; then - print_core "$app" "$core" >&2 - "$_sudo" rm "$core" - else - print_core "$app" "$core" - fi - done - if test "$app" != quiet ; then - fail 'cores' 'Core dumps found' - fi -} - -check_logs() { - # Iterate through each log to remove an useless warning. - # shellcheck disable=SC2044 - for log in $(find "${1}" -type f -name "${2}"); do - sed -i "${log}" \ - -e '/Warning: noted but unhandled ioctl/d' \ - -e '/could cause spurious value errors to appear/d' \ - -e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d' - done - - # Now do it again, but only consider files with size > 0. - local err="" - # shellcheck disable=SC2044 - for log in $(find "${1}" -type f -name "${2}" -size +0); do - cat "${log}" - err=1 - rm "${log}" - done - if test -n "${err}" ; then - fail 'logs' 'Runtime errors detected.' - fi -} - -valgrind_check() { - check_logs "${1}" "valgrind-*" -} - -check_sanitizer() { - if test -n "${CLANG_SANITIZER}"; then - check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat} - fi -} - -unittests() {( - ulimit -c unlimited || true - if ! build_make unittest ; then - fail 'unittests' 'Unit tests failed' - fi - submit_coverage unittest - check_core_dumps "$(command -v luajit)" -)} - -functionaltests() {( - ulimit -c unlimited || true - if ! build_make "${FUNCTIONALTEST}"; then - fail 'functionaltests' 'Functional tests failed' - fi - submit_coverage functionaltest - check_sanitizer "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -)} - -oldtests() {( - ulimit -c unlimited || true - if ! make oldtest; then - reset - fail 'oldtests' 'Legacy tests failed' - fi - submit_coverage oldtest - check_sanitizer "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -)} - -check_runtime_files() {( - local test_name="$1" ; shift - local message="$1" ; shift - local tst="$1" ; shift - - cd runtime - for file in $(git ls-files "$@") ; do - # Check that test is not trying to work with files with spaces/etc - # Prefer failing the build over using more robust construct because files - # with IFS are not welcome. - if ! test -e "$file" ; then - fail "$test_name" "It appears that $file is only a part of the file name" - fi - if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then - fail "$test_name" "$(printf "%s%s" "$message" "$file")" - fi - done -)} - -install_nvim() {( - if ! build_make install ; then - fail 'install' 'make install failed' - exit 1 - fi - - "${INSTALL_PREFIX}/bin/nvim" --version - if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then - echo "Running ':help' in the installed nvim failed." - echo "Maybe the helptags have not been generated properly." - fail 'help' 'Failed running :help' - fi - - # Check that all runtime files were installed - check_runtime_files \ - 'runtime-install' \ - 'It appears that %s is not installed.' \ - -e \ - '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' - - # Check that some runtime files are installed and are executables - check_runtime_files \ - 'not-exe' \ - 'It appears that %s is not installed or is not executable.' \ - -x \ - '*.awk' '*.sh' '*.bat' - - # Check that generated syntax file has function names, #5060. - local genvimsynf=syntax/vim/generated.vim - local gpat='syn keyword vimFuncName .*eval' - if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then - fail 'funcnames' "It appears that $genvimsynf does not contain $gpat." - fi -)} diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100755 index 5925cc7b02..0000000000 --- a/ci/install.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -# Use default CC to avoid compilation problems when installing Python modules. -echo "Install neovim module for Python." -CC=cc python3 -m pip -q install --user --upgrade pynvim - -echo "Install neovim RubyGem." -gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim - -echo "Install neovim npm package" -npm install -g neovim -npm link neovim - -if [[ $CI_OS_NAME != osx ]]; then - sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log" - perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION' -fi diff --git a/ci/run_tests.sh b/ci/run_tests.sh deleted file mode 100755 index 0ef7080628..0000000000 --- a/ci/run_tests.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -set -e -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" - -rm -f "$END_MARKER" - -# Run all tests (with some caveats) if no input argument is given -if (($# == 0)); then - tests=('build_nvim') - - # Additional threads aren't created in the unit/old tests - if test "$CLANG_SANITIZER" != "TSAN"; then - if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then - tests+=('unittests') - fi - tests+=('oldtests') - fi - - tests+=('functionaltests' 'install_nvim') -else - tests=("$@") -fi - -for i in "${tests[@]}"; do - eval "$i" || fail "$i" -done - -end_tests - -if [[ -s "${GCOV_ERROR_FILE}" ]]; then - echo '=== Unexpected gcov errors: ===' - cat "${GCOV_ERROR_FILE}" - exit 1 -fi |