diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/before_install.sh | 16 | ||||
-rw-r--r-- | ci/build.ps1 | 40 | ||||
-rw-r--r-- | ci/common/build.sh | 4 | ||||
-rw-r--r-- | ci/common/suite.sh | 7 | ||||
-rw-r--r-- | ci/common/test.sh | 4 | ||||
-rwxr-xr-x | ci/install.sh | 4 |
6 files changed, 38 insertions, 37 deletions
diff --git a/ci/before_install.sh b/ci/before_install.sh index 9a3e192536..86dd78af48 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -8,7 +8,7 @@ if [[ "${CI_TARGET}" == lint ]]; then fi if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - brew update + >/dev/null brew update fi echo 'python info:' @@ -24,17 +24,15 @@ echo 'python info:' ) | sed 's/^/ /' if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - echo "Upgrade Python 3." - brew upgrade python - echo "Upgrade Python 3 pip." - pip3 -q install --user --upgrade pip + echo "Upgrade Python 3 pip" + python3 -m pip -q install --user --upgrade pip else - echo "Upgrade Python 2 pip." - pip2.7 -q install --user --upgrade pip - echo "Upgrade Python 3 pip." + echo "Upgrade Python 2 pip" + python2.7 -m pip -q install --user --upgrade pip + echo "Upgrade Python 3 pip" # Allow failure. pyenv pip3 on travis is broken: # https://github.com/travis-ci/travis-ci/issues/8363 - pip3 -q install --user --upgrade pip || true + python3 -m pip -q install --user --upgrade pip || true fi echo "Install node (LTS)" diff --git a/ci/build.ps1 b/ci/build.ps1 index 7e686f3464..7097da8c32 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -1,4 +1,5 @@ -Set-PSDebug -Trace 1 +$ErrorActionPreference = 'stop' +Set-PSDebug -Strict -Trace 1 $env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$' $compiler = $Matches.compiler @@ -12,14 +13,16 @@ $nvimCmakeVars = @{ CMAKE_BUILD_TYPE = $cmakeBuildType; BUSTED_OUTPUT_TYPE = 'nvim'; } +$uploadToCodeCov = $false # For pull requests, skip some build configurations to save time. -if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32)$') { +if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32|MINGW_64-gcov)$') { exit 0 } function exitIfFailed() { if ($LastExitCode -ne 0) { + Set-PSDebug -Off exit $LastExitCode } } @@ -38,15 +41,21 @@ if ($compiler -eq 'MINGW') { # These are native MinGW builds, but they use the toolchain inside # MSYS2, this allows using all the dependencies and tools available # in MSYS2, but we cannot build inside the MSYS2 shell. - $cmakeGenerator = 'MinGW Makefiles' - $cmakeGeneratorArgs = 'VERBOSE=1' + $cmakeGenerator = 'Ninja' + $cmakeGeneratorArgs = '-v' + $mingwPackages = @('ninja', 'cmake', 'perl', 'diffutils', 'unibilium').ForEach({ + "mingw-w64-$arch-$_" + }) # Add MinGW to the PATH $env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH" + # Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068 + & C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg + # Build third-party dependencies C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed - C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-$arch-cmake mingw-w64-$arch-perl mingw-w64-$arch-diffutils mingw-w64-$arch-unibilium" ; exitIfFailed + C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed } elseif ($compiler -eq 'MSVC') { $cmakeGeneratorArgs = '/verbosity:normal' @@ -58,9 +67,6 @@ elseif ($compiler -eq 'MSVC') { } } -# Remove Git Unix utilities from the PATH -$env:PATH = $env:PATH.Replace('C:\Program Files\Git\usr\bin', '') - # Setup python (use AppVeyor system python) C:\Python27\python.exe -m pip install neovim ; exitIfFailed C:\Python35\python.exe -m pip install neovim ; exitIfFailed @@ -72,18 +78,20 @@ python -c "import neovim; print(str(neovim))" ; exitIfFailed python3 -c "import neovim; print(str(neovim))" ; exitIfFailed $env:PATH = "C:\Ruby24\bin;$env:PATH" -cmd /c gem.cmd install neovim ; exitIfFailed -where.exe neovim-ruby-host.bat ; exitIfFailed +gem.cmd install neovim +Get-Command -CommandType Application neovim-ruby-host.bat -cmd /c npm.cmd install -g neovim ; exitIfFailed -where.exe neovim-node-host.cmd ; exitIfFailed -cmd /c npm link neovim +npm.cmd install -g neovim +Get-Command -CommandType Application neovim-node-host.cmd +npm.cmd link neovim function convertToCmakeArgs($vars) { return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" } } -mkdir .deps +if (-Not (Test-Path -PathType container .deps)) { + mkdir .deps +} cd .deps cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed @@ -103,11 +111,11 @@ $failed = $false Set-PSDebug -Off cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 | foreach { $failed = $failed -or - $_ -match 'Running functional tests failed with error'; $_ } -Set-PSDebug -Trace 1 + $_ -match 'functional tests failed with error'; $_ } if ($failed) { exit $LastExitCode } +Set-PSDebug -Strict -Trace 1 if ($uploadToCodecov) { diff --git a/ci/common/build.sh b/ci/common/build.sh index a3cf64d47a..7c27d61586 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -7,7 +7,7 @@ _stat() { } top_make() { - echo '================================================================================' + printf '%78s\n' | tr ' ' '=' # Travis has 1.5 virtual cores according to: # http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM ninja "$@" @@ -35,7 +35,7 @@ build_deps() { elif test -f "${CACHE_MARKER}" ; then echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))." cp -r "${HOME}/.cache/nvim-deps"/. "${DEPS_BUILD_DIR}" - cp -r "${HOME}/.cache/nvim-deps-downloads" "${DEPS_DOWNLOAD_DIR}" + cp -r "${HOME}/.cache/nvim-deps-downloads"/. "${DEPS_DOWNLOAD_DIR}" fi # Even if we're using cached dependencies, run CMake and make to diff --git a/ci/common/suite.sh b/ci/common/suite.sh index d3fbcd1eda..8feb642547 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -39,13 +39,6 @@ enter_suite() { exit_suite() { set +x - if test -f "$NVIM_LOG_FILE" ; then - printf "===============================================================================\n" - printf "NVIM_LOG_FILE: $NVIM_LOG_FILE\n" - cat "$NVIM_LOG_FILE" 2>/dev/null || printf '(empty)' - printf "\n" - rm -rf "$NVIM_LOG_FILE" - fi travis_fold end "${NVIM_TEST_CURRENT_SUITE}" if test $FAILED -ne 0 ; then echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:" diff --git a/ci/common/test.sh b/ci/common/test.sh index bc80dfead7..a6afd1df4c 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -34,8 +34,10 @@ check_core_dumps() { local app="${1:-${BUILD_DIR}/bin/nvim}" if test "${TRAVIS_OS_NAME}" = osx ; then local cores="$(find /cores/ -type f -print)" + local _sudo='sudo' else local cores="$(find ./ -type f -name 'core.*' -print)" + local _sudo= fi if test -z "${cores}" ; then @@ -45,7 +47,7 @@ check_core_dumps() { for core in $cores; do if test "$del" = "1" ; then print_core "$app" "$core" >&2 - rm "$core" + "$_sudo" rm "$core" else print_core "$app" "$core" fi diff --git a/ci/install.sh b/ci/install.sh index e95e2f29c1..2cb8e78e67 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -18,14 +18,14 @@ fi echo "Install neovim module for Python 3." # Allow failure. pyenv pip3 on travis is broken: # https://github.com/travis-ci/travis-ci/issues/8363 -CC=cc pip3 -q install --user --upgrade neovim || true +CC=cc python3 -m pip -q install --user --upgrade neovim || true if ! [ "${TRAVIS_OS_NAME}" = osx ] ; then # Update PATH for pip. export PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH" # Use default CC to avoid compilation problems when installing Python modules. echo "Install neovim module for Python 2." - CC=cc pip2.7 -q install --user --upgrade neovim + CC=cc python2.7 -m pip -q install --user --upgrade neovim echo "Install neovim RubyGem." gem install --no-document --version ">= 0.2.0" neovim |