ci: delete ci/ (#22227)

Having CI scripts that is separate from the build system causes
tremendous amounts of problems, headaches and bugs. Testing the validity
of the scripts locally become near impossible as time goes on as they're
only vetted if it works on whatever CI provider we happened to have at
the time, with their own quirks and behavior.

The extra indirection between "cmake <-> general CI scripts <-> GHA" is
also a frequent source of problems, as the orchestration needs to be
done with environment variables, cmake flags and github actions matrix
strategy. This combination has turned out to be exceptionally fragile.

Examples:
15394b6855
13aa23b62a
https://github.com/neovim/neovim/pull/22072#discussion_r1094390713

A lot of the code was inlined to .github/workflows/ci.yml without
further modifications. While this in itself doesn't integrate with our
build system any more than the current situation, it does
1. remove a level of indirection, and more importantly
2. allow us to slowly start integrating the CI into our build system now
   that all the relevant code is in one place.
This commit is contained in:
dundargoc 2023-02-12 11:50:08 +01:00 committed by GitHub
parent 3a5dddf24f
commit e81b4274fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 90 additions and 141 deletions

View File

@ -208,8 +208,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
- name: Set up environment
run: |
./.github/workflows/env.sh ${{ matrix.flavor }}
ulimit -c unlimited
- name: Create log dir
run: mkdir -p "${LOG_DIR}"
@ -225,7 +227,22 @@ jobs:
brew install automake cpanminus ninja
- name: Setup interpreter packages
run: ./ci/install.sh
run: |
# 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 "$BIN_DIR" --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
- uses: ./.github/actions/cache
@ -251,18 +268,23 @@ jobs:
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Unittests
name: Unittest
timeout-minutes: 5
run: ./ci/run_tests.sh unittests
run: cmake --build build --target unittest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Functionaltests
- if: matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Functionaltest
timeout-minutes: 15
run: ./ci/run_tests.sh functionaltests
run: cmake --build build --target functionaltest
- if: matrix.flavor == 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Functionaltest with PUC Lua
timeout-minutes: 15
run: cmake --build build --target functionaltest-lua
- if: matrix.flavor != 'tsan' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Oldtests
run: ./ci/run_tests.sh oldtests
name: Oldtest
run: make oldtest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Install
@ -270,12 +292,66 @@ jobs:
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Installtests
run: ./ci/run_tests.sh installtests
run: |
"${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."
echo 'Failed running :help'
exit 1
fi
# Check that all runtime files were installed
for file in $(git -C runtime ls-files '*.vim' '*.ps' '*.dict' '*.py' '*.tutor'); do
if ! test -e "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
printf "%s%s" 'It appears that %s is not installed.' "$file"
exit 1
fi
done
# Check that some runtime files are installed and are executables
for file in $(git -C runtime ls-files '*.awk' '*.sh' '*.bat'); do
if ! test -x "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
printf "%s%s" 'It appears that %s is not installed or is not executable.' "$file"
exit 1
fi
done
# Check that generated syntax file has function names, #5060.
genvimsynf=syntax/vim/generated.vim
gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
echo "It appears that $genvimsynf does not contain $gpat."
exit 1
fi
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Show logs
run: cat $(find "$LOG_DIR" -type f)
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Show core dumps
run: |
app="${1:-${BUILD_DIR}/bin/nvim}"
if test "${CI_OS_NAME}" = osx; then
cores="$(find /cores/ -type f -print)"
else
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
fi
if test -z "${cores}"; then
exit 0
fi
for core in $cores; do
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
done
echo 'Core dumps found'
exit 1
old_cmake:
name: Test oldest supported cmake
runs-on: ubuntu-22.04
@ -371,15 +447,15 @@ jobs:
"status=${{ job.status }}" >> $env:GITHUB_OUTPUT
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run functionaltests
name: Run functionaltest
timeout-minutes: 15
run: cmake --build build --target functionaltest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run oldtests
name: Run oldtest
run: |
# Add MSYS to path, required for e.g. `find` used in test scripts.
# But would break functionaltests, where its `more` would be used then.
# But would break functionaltest, where its `more` would be used then.
$OldPath = $env:PATH
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path src\nvim\testdir) VERBOSE=1

View File

@ -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 "$BIN_DIR" --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

View File

@ -1,107 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
print_core() {
local app="$1"
local core="$2"
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 app="${1:-${BUILD_DIR}/bin/nvim}"
local cores
if test "${CI_OS_NAME}" = osx; then
cores="$(find /cores/ -type f -print)"
else
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
fi
if test -z "${cores}"; then
return
fi
local core
for core in $cores; do
print_core "$app" "$core"
done
echo 'Core dumps found'
exit 1
}
unittests() {(
ulimit -c unlimited || true
ninja -C "${BUILD_DIR}" unittest || exit
check_core_dumps "$(command -v luajit)"
)}
functionaltests() {(
ulimit -c unlimited || true
ninja -C "${BUILD_DIR}" "${FUNCTIONALTEST}" || exit
check_core_dumps
)}
oldtests() {(
ulimit -c unlimited || true
if ! make oldtest; then
reset
exit 1
fi
check_core_dumps
)}
check_runtime_files() {(
local message="$1"; shift
local tst="$1"; shift
for file in $(git -C runtime 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
echo "It appears that $file is only a part of the file name"
exit 1
fi
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
printf "%s%s" "$message" "$file"
exit 1
fi
done
)}
installtests() {(
"${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."
echo 'Failed running :help'
exit 1
fi
# Check that all runtime files were installed
check_runtime_files \
'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 \
'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
echo "It appears that $genvimsynf does not contain $gpat."
exit 1
fi
)}
eval "$*" || exit