diff options
Diffstat (limited to 'ci/build.ps1')
-rw-r--r-- | ci/build.ps1 | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/ci/build.ps1 b/ci/build.ps1 index c82a74714c..5b3eb4d27d 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,6 +13,7 @@ $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|MINGW_64-gcov)$') { @@ -20,6 +22,7 @@ if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSV function exitIfFailed() { if ($LastExitCode -ne 0) { + Set-PSDebug -Off exit $LastExitCode } } @@ -38,15 +41,18 @@ 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" # 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 +64,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 +75,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 @@ -104,10 +109,10 @@ Set-PSDebug -Off cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 | foreach { $failed = $failed -or $_ -match 'functional tests failed with error'; $_ } -Set-PSDebug -Trace 1 if ($failed) { exit $LastExitCode } +Set-PSDebug -Strict -Trace 1 if ($uploadToCodecov) { |