Skip to content

Commit

Permalink
Improve AppVeyor configuration
Browse files Browse the repository at this point in the history
Move AppVeyor configuration to its own batch script.
Fix cache issue with target folder in racerd submodule.
Add caching for NPM and pip.
  • Loading branch information
micbou committed Jan 8, 2016
1 parent 3c10266 commit 59cb588
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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
compiler:
- gcc
script: ./run_tests.py
Expand Down
26 changes: 4 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,13 @@ environment:
- msvc: 14
arch: 64
install:
- git submodule update --init --recursive
- ps: $env:python = if ($env:arch -eq 32) { 'C:\Python27' } else { 'C:\Python27-x64' }
- set PATH=%python%;%python%\Scripts;%PATH%
- python --version
# Manually setting PYTHONHOME for python 2.7.11 fix the following error when
# running core tests: "ImportError: No module named site"
# TODO: check if this is still needed when python 2.7.12 is released.
- set PYTHONHOME=%python%
- ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:\get-pip.py')
- python C:\get-pip.py
- pip install -r test_requirements.txt
- npm install -g typescript
# The gnu rust compiler is used since, on windows 10, there is a workaround
# needed for the msvc versions. However, the workaround sets Omnisharp build
# config to 64-bit release mode which results in a failed build.
- ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-1.5.0-i686-pc-windows-gnu.exe'
- rust-1.5.0-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
# TODO MinGW can be removed once the msvc rust compiler is used.
- SET PATH=C:\Program Files (x86)\Rust\bin;C:\MinGW\bin;%PATH%
- rustc -Vv
- cargo -Vv
- ci\appveyor\appveyor_install.bat
build_script:
- python run_tests.py --msvc %MSVC%
# Disable automatic tests
test: off
cache:
- 'C:\Users\appveyor\.cargo -> third_party\racerd'
- '%USERPROFILE%\.cargo -> third_party\racerd'
- 'third_party\racerd\target -> third_party\racerd'
- '%LOCALAPPDATA%\pip\cache'
- '%APPDATA%\npm-cache'
5 changes: 5 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Travis and AppVeyor Scripts
===========================

This directory contains scripts used for testing `ycmd` on Travis and AppVeyor CIs. They
should not normally be run by users.
56 changes: 56 additions & 0 deletions ci/appveyor/appveyor_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
:: Since we are caching target folder in racerd submodule and git cannot clone
:: a submodule in a non-empty folder, we move out the cached folder and move it
:: back after cloning submodules.
if exist third_party\racerd\target (
move third_party\racerd\target racerd_target
)

git submodule update --init --recursive

if exist racerd_target (
move racerd_target third_party\racerd\target
)

::
:: Python configuration
::

if %arch% == 32 (
set python=C:\Python27
) else (
set python=C:\Python27-x64
)

set PATH=%python%;%python%\Scripts;%PATH%
python --version
:: Manually setting PYTHONHOME for python 2.7.11 fix the following error when
:: running core tests: "ImportError: No module named site"
:: TODO: check if this is still needed when python 2.7.12 is released.
set PYTHONHOME=%python%

appveyor DownloadFile https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
pip install -r test_requirements.txt

::
:: Typescript configuration
::

:: Since npm executable is a batch file, we need to prefix it with a call
:: statement. See https://github.com/npm/npm/issues/2938
call npm install -g typescript

::
:: Rust configuration
::

:: The gnu rust compiler is used since, on windows 10, there is a workaround
:: needed for the msvc versions. However, the workaround sets Omnisharp build
:: config to 64-bit release mode which results in a failed build.
appveyor DownloadFile https://static.rust-lang.org/dist/rust-1.5.0-i686-pc-windows-gnu.exe
rust-1.5.0-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
:: TODO: MinGW can be removed once the msvc rust compiler is used.
set PATH=C:\Program Files (x86)\Rust\bin;C:\MinGW\bin;%PATH%

rustc -Vv
cargo -V
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion travis/travis_install.sh → ci/travis/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ YCMD_VENV_DIR=${HOME}/venvs/ycmd_test
# - create (but don't activate) a virtualenv for the python version
# ${YCMD_PYTHON_VERSION} in the directory ${YCMD_VENV_DIR}, e.g.
# virtualenv -p python${YCMD_PYTHON_VERSION} ${YCMD_VENV_DIR}
source travis/travis_install.${TRAVIS_OS_NAME}.sh
source ci/travis/travis_install.${TRAVIS_OS_NAME}.sh

# virtualenv doesn't copy python-config https://github.com/pypa/virtualenv/issues/169
# but our build system uses it
Expand Down
5 changes: 0 additions & 5 deletions travis/README.md

This file was deleted.

0 comments on commit 59cb588

Please sign in to comment.