From 0a1f5bd50ac95d98f3ef5cc6b756717c21e2d6f0 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 3 Dec 2017 22:09:22 +0100 Subject: [PATCH] Merge pull request #586 from pv/travis-cache CI: cache pip files and miniconda download (cherry picked from commit e93eb40f9136df149a8ee2980d04c5db92ce278a) --- .travis.yml | 17 +++++++++++++---- appveyor.yml | 11 +++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c7bb459fb..6071ba713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,15 +44,24 @@ matrix: SKIP="$SKIP|asv/benchmark.py.*undefined name .(run|params)." PYFLAKES_NODOCTEST=1 pyflakes asv test | grep -E -v "$SKIP" > test.out; cat test.out; test \! -s test.out +cache: + directories: + - $HOME/.cache/pip + - $HOME/download + install: - | - set -ev + set -e export TRAVIS_PYTHON=`which python` export TRAVIS_PIP=`which pip` if [[ $USE_CONDA == true ]]; then - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - chmod +x miniconda.sh; - ./miniconda.sh -b; + mkdir -p $HOME/download; + export MINICONDA_SH="Miniconda3-4.3.30-Linux-x86_64.sh"; + pushd $HOME/download; + wget -N https://repo.continuum.io/miniconda/$MINICONDA_SH; + chmod +x $MINICONDA_SH; + ./$MINICONDA_SH -b; + popd; export PATH=$HOME/miniconda3/bin:$PATH; conda update --yes conda; mv $HOME/miniconda3/bin/conda $HOME/miniconda3/bin/conda.real; diff --git a/appveyor.yml b/appveyor.yml index 2d401e761..0012d9ab9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,9 @@ environment: platform: x86 PYTHON_ARCH: "32" +cache: + - '%LOCALAPPDATA%\pip\Cache' + install: # Clear tmpdir (sometimes left behind by appveyor?) - rmdir /s /q %APPVEYOR_BUILD_FOLDER%\\tmp & exit /b 0 @@ -55,3 +58,11 @@ build: false test_script: - "python -m pytest --timeout=360 -l --basetemp=%APPVEYOR_BUILD_FOLDER%\\tmp test" + +after_build: + # Clear up pip cache + - 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"