ci: remove unnecessary variables and functions (#22150)

This commit is contained in:
dundargoc
2023-02-07 09:27:51 +01:00
committed by GitHub
parent 1391385ba9
commit adae075fcf
6 changed files with 51 additions and 80 deletions

View File

@@ -5,8 +5,6 @@ set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source-path=SCRIPTDIR # shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/build.sh"
# shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/suite.sh" source "${CI_DIR}/common/suite.sh"
mkdir -p "${HOME}/.cache" mkdir -p "${HOME}/.cache"
@@ -22,5 +20,5 @@ if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}" mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}"
touch "${CACHE_MARKER}" touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))." echo "Updated third-party dependencies."
fi fi

View File

@@ -3,22 +3,34 @@
set -e set -e
set -o pipefail 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. # Test some of the configuration variables.
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
echo "\$GCOV: '${GCOV}' is not executable." echo "\$GCOV: '${GCOV}' is not executable."
exit 1 exit 1
fi fi
if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; then
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable." if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then
exit 1 DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi fi
# Compile dependencies. mkdir -p "${DEPS_BUILD_DIR}"
build_deps
# 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
# 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. # Install cluacov for Lua coverage.
if [[ "$USE_LUACOV" == 1 ]]; then if [[ "$USE_LUACOV" == 1 ]]; then

View File

@@ -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}"
}

View File

@@ -34,8 +34,3 @@ ended_successfully() {
fi fi
return 0 return 0
} }
end_tests() {
touch "${END_MARKER}"
ended_successfully
}

View File

@@ -1,4 +1,3 @@
. "${CI_DIR}/common/build.sh"
. "${CI_DIR}/common/suite.sh" . "${CI_DIR}/common/suite.sh"
submit_coverage() { submit_coverage() {
@@ -84,7 +83,7 @@ valgrind_check() {
check_sanitizer() { check_sanitizer() {
if test -n "${CLANG_SANITIZER}"; then if test -n "${CLANG_SANITIZER}"; then
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat} check_logs "${1}" "*san.*" | cat
fi fi
} }

View File

@@ -5,12 +5,36 @@ set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source-path=SCRIPTDIR # shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/build.sh"
# shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/test.sh" source "${CI_DIR}/common/test.sh"
# shellcheck source-path=SCRIPTDIR # shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/suite.sh" 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" rm -f "$END_MARKER"
# Run all tests (with some caveats) if no input argument is given # 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" eval "$i" || fail "$i"
done done
end_tests touch "${END_MARKER}"
ended_successfully
if [[ -s "${GCOV_ERROR_FILE}" ]]; then if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ===' echo '=== Unexpected gcov errors: ==='