diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-02-12 11:50:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 11:50:08 +0100 |
commit | e81b4274fc18de4be753c07db642111129ff84ee (patch) | |
tree | 1ae8e56eebca357d2263e713c5519eb772207ce7 | |
parent | 3a5dddf24f9d4d8959194b0cd3c6a7dd0cbd73ae (diff) | |
download | rneovim-e81b4274fc18de4be753c07db642111129ff84ee.tar.gz rneovim-e81b4274fc18de4be753c07db642111129ff84ee.tar.bz2 rneovim-e81b4274fc18de4be753c07db642111129ff84ee.zip |
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:
https://github.com/neovim/neovim/commit/15394b6855c3b17be06bf2bfbac7797d9c3ebf1d
https://github.com/neovim/neovim/commit/13aa23b62af4df3e7f10687b76fe8c04efa2a598
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.
-rw-r--r-- | .github/workflows/ci.yml | 104 | ||||
-rwxr-xr-x | ci/install.sh | 20 | ||||
-rwxr-xr-x | ci/run_tests.sh | 107 |
3 files changed, 90 insertions, 141 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 082d0babb3..3135bba571 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: 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: ./ci/run_tests.sh functionaltests + 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 diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100755 index d65c86032b..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 "$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 diff --git a/ci/run_tests.sh b/ci/run_tests.sh deleted file mode 100755 index 8bdc164295..0000000000 --- a/ci/run_tests.sh +++ /dev/null @@ -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 |