From d3e7112a3ddbd284b5a185102ba28c58ef878457 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Tue, 26 Sep 2017 08:54:07 +0200 Subject: [PATCH] CI: Cache improvements --- .travis.yml | 15 ++++++++++++++- appveyor.yml | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 79575404f..600a9ad98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: - | diff --git a/appveyor.yml b/appveyor.yml index 81bcf50b5..677ea0cec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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'