From 1b0a8ea6e8eb319935b630ec25320c42eba86b63 Mon Sep 17 00:00:00 2001 From: micbou Date: Mon, 29 Feb 2016 05:31:58 +0100 Subject: [PATCH] Update AppVeyor configuration Create AppVeyor batch script and move CI scripts to a separate folder. --- .travis.yml | 2 +- appveyor.yml | 14 +++++---- ci/appveyor/appveyor_install.bat | 29 +++++++++++++++++++ {travis => ci/travis}/travis_install.linux.sh | 0 {travis => ci/travis}/travis_install.osx.sh | 0 {travis => ci/travis}/travis_install.sh | 2 +- 6 files changed, 39 insertions(+), 8 deletions(-) create mode 100755 ci/appveyor/appveyor_install.bat rename {travis => ci/travis}/travis_install.linux.sh (100%) rename {travis => ci/travis}/travis_install.osx.sh (100%) rename {travis => ci/travis}/travis_install.sh (96%) diff --git a/.travis.yml b/.travis.yml index a5dd8824..2aff6191 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_install: - git submodule update --init --recursive install: # source because it sets up env vars on some platforms - - source travis/travis_install.sh + - source ci/travis/travis_install.sh script: ./run_tests.py env: matrix: diff --git a/appveyor.yml b/appveyor.yml index 3a5aba4a..6ea70627 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,15 +2,17 @@ version: '{build}' environment: matrix: - arch: 32 + python: 35 + # We only test Python 2.7 on 64 bits. - arch: 64 + python: 27 + - arch: 64 + python: 35 install: - - git submodule update --init --recursive - - ps: $env:python = if ($env:arch -eq 32) { 'C:\Python27' } else { 'C:\Python27-x64' } - - appveyor DownloadFile https://bootstrap.pypa.io/get-pip.py - - set PATH=%python%;%python%\Scripts;%PATH% - - python get-pip.py - - pip install -r python\test_requirements.txt + - ci\appveyor\appveyor_install.bat build_script: - python run_tests.py # Disable automatic tests test: off +cache: + - '%LOCALAPPDATA%\pip\cache' # Python packages from pip diff --git a/ci/appveyor/appveyor_install.bat b/ci/appveyor/appveyor_install.bat new file mode 100755 index 00000000..c6f618f5 --- /dev/null +++ b/ci/appveyor/appveyor_install.bat @@ -0,0 +1,29 @@ +git submodule update --init --recursive +:: Batch script will not exit if a command returns an error, so we manually do +:: it for commands that may fail. +if %errorlevel% neq 0 exit /b %errorlevel% + +:: +:: Python configuration +:: + +if %arch% == 32 ( + set python_path=C:\Python%python% +) else ( + set python_path=C:\Python%python%-x64 +) + +set PATH=%python_path%;%python_path%\Scripts;%PATH% +python --version + +:: When using Python 3 on AppVeyor, CMake will always pick the 64 bits +:: libraries. We specifically tell CMake the right path to the libraries +:: according to the architecture. +if %python% == 35 ( + set EXTRA_CMAKE_ARGS="-DPYTHON_LIBRARY=%python_path%\libs\python%python%.lib" +) + +appveyor DownloadFile https://bootstrap.pypa.io/get-pip.py +python get-pip.py +pip install -r python\test_requirements.txt +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/travis/travis_install.linux.sh b/ci/travis/travis_install.linux.sh similarity index 100% rename from travis/travis_install.linux.sh rename to ci/travis/travis_install.linux.sh diff --git a/travis/travis_install.osx.sh b/ci/travis/travis_install.osx.sh similarity index 100% rename from travis/travis_install.osx.sh rename to ci/travis/travis_install.osx.sh diff --git a/travis/travis_install.sh b/ci/travis/travis_install.sh similarity index 96% rename from travis/travis_install.sh rename to ci/travis/travis_install.sh index b9067c4c..3a9b237d 100644 --- a/travis/travis_install.sh +++ b/ci/travis/travis_install.sh @@ -9,7 +9,7 @@ set -ev # Requirements of OS-specific install: # - install any software which is not installed by Travis configuration # - set up everything necessary so that pyenv can build python -source travis/travis_install.${TRAVIS_OS_NAME}.sh +source ci/travis/travis_install.${TRAVIS_OS_NAME}.sh ############# # pyenv setup