diff --git a/.appveyor.yml b/.appveyor.yml index 600a51419..9a4028780 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,6 +14,9 @@ install: - C:\Python%PYTHON%\python.exe -m pip install -U pip setuptools - C:\Python%PYTHON%\python.exe -m pip install .[test,websupport] +cache: + - '%LOCALAPPDATA%\pip\Cache' + # No automatic build, just run python tests build: off @@ -39,3 +42,17 @@ test_script: after_test: - ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path (Join-Path tests .junit.xml))) + +after_build: + # Remove old or huge cache files to hopefully not exceed the 1GB cache limit. + # + # If the cache limit is reached, the cache will not be updated (of not even + # created in the first run). So this is a trade of between keeping the cache + # current and having a cache at all. + # NB: This is done only `on_success` since the cache in uploaded only on + # success anyway. + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete + # Show size of cache + - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"