CI: Cache improvements

This commit is contained in:
JustArchi 2017-09-26 08:54:07 +02:00
parent 807284515b
commit d3e7112a3d
2 changed files with 17 additions and 2 deletions

View file

@ -25,7 +25,20 @@ env:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
- RUNTIMES="generic win-x64 linux-x64 linux-arm osx-x64" # https://github.com/travis-ci/travis-ci/issues/1444
before_script: dotnet restore
cache:
directories:
- $HOME/.local/share/NuGet
- $HOME/.nuget
before_script:
- |
set -e
if git diff --name-only HEAD^ HEAD | grep -Fq '.csproj'; then
dotnet nuget locals -c all
fi
dotnet restore
script:
- |

View file

@ -31,7 +31,9 @@ install:
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1' -OutFile '.\scripts\obtain\dotnet-install.ps1'
.\scripts\obtain\dotnet-install.ps1 -Channel "$env:DOTNET_CHANNEL" -InstallDir "$env:DOTNET_INSTALL_DIR"
cache: '%UserProfile%\.nuget\packages -> **\*.csproj'
cache:
- '%LocalAppData%\NuGet -> **\*.csproj'
- '%UserProfile%\.nuget -> **\*.csproj'
before_build:
- ps: >-
$ErrorActionPreference = 'Stop'