CI/AppVeyor: per-compiler deps cache #9852

The deps cache does not work for MSVC builds because the MINGW builds
ovewrite it.  Cache saves 10+ minutes on the build.
This commit is contained in:
Justin M. Keyes 2019-04-07 03:54:22 +02:00 committed by GitHub
parent 805b5f2e1e
commit a7a56293aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View File

@ -18,8 +18,10 @@ build_script:
- powershell ci\build.ps1 - powershell ci\build.ps1
cache: cache:
- C:\msys64\var\cache\pacman\pkg -> ci\build.ps1 - C:\msys64\var\cache\pacman\pkg -> ci\build.ps1
- .deps -> ci\build.ps1 - deps-MINGW -> ci\build.ps1
- .deps -> third-party\** - deps-MSVC -> ci\build.ps1
- deps-MINGW -> third-party\**
- deps-MSVC -> third-party\**
artifacts: artifacts:
- path: build/Neovim.zip - path: build/Neovim.zip
- path: build/bin/nvim.exe - path: build/bin/nvim.exe

View File

@ -6,12 +6,15 @@ $compiler = $Matches.compiler
$compileOption = $Matches.option $compileOption = $Matches.option
$bits = $Matches.bits $bits = $Matches.bits
$cmakeBuildType = 'RelWithDebInfo' $cmakeBuildType = 'RelWithDebInfo'
$depsDir = [System.IO.Path]::GetFullPath("deps-$($compiler)")
$depsCmakeVars = @{ $depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType; CMAKE_BUILD_TYPE = $cmakeBuildType;
} }
$nvimCmakeVars = @{ $nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType; CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim'; BUSTED_OUTPUT_TYPE = 'nvim';
DEPS_BUILD_DIR=$depsDir;
DEPS_PREFIX="$($depsDir)/usr";
} }
$uploadToCodeCov = $false $uploadToCodeCov = $false
@ -89,10 +92,10 @@ function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" } return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
} }
if (-Not (Test-Path -PathType container .deps)) { if (-Not (Test-Path -PathType container $depsDir)) {
mkdir .deps mkdir "$depsDir"
} }
cd .deps cd "$depsDir"
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd .. cd ..

View File

@ -1,7 +1,5 @@
local deps_prefix = './.deps/usr' local deps_prefix = (os.getenv('DEPS_PREFIX') and os.getenv('DEPS_PREFIX')
if os.getenv('DEPS_PREFIX') then or './.deps/usr')
deps_prefix = os.getenv('DEPS_PREFIX')
end
package.path = deps_prefix .. '/share/lua/5.1/?.lua;' .. package.path = deps_prefix .. '/share/lua/5.1/?.lua;' ..
deps_prefix .. '/share/lua/5.1/?/init.lua;' .. deps_prefix .. '/share/lua/5.1/?/init.lua;' ..

View File

@ -235,6 +235,11 @@ local function hasenv(name)
return nil return nil
end end
local function deps_prefix()
local env = os.getenv('DEPS_PREFIX')
return (env and env ~= '') and env or '.deps/usr'
end
local tests_skipped = 0 local tests_skipped = 0
local function check_cores(app, force) local function check_cores(app, force)
@ -263,7 +268,7 @@ local function check_cores(app, force)
else else
initial_path = '.' initial_path = '.'
re = '/core[^/]*$' re = '/core[^/]*$'
exc_re = { '^/%.deps$', local_tmpdir, '^/%node_modules$' } exc_re = { '^/%.deps$', '^/%'..deps_prefix()..'$', local_tmpdir, '^/%node_modules$' }
db_cmd = gdb_db_cmd db_cmd = gdb_db_cmd
random_skip = true random_skip = true
end end