branches:
  only:
  - master

version: '0.1.0.{build}'

platform:
  - x64
  - x86

environment:
  matrix:
    - PYTHON: "C:\\Miniconda35-x64\\Scripts\\activate.bat"
      PYTHON_VERSION: 3.5
    - PYTHON: "C:\\Miniconda36-x64\\Scripts\\activate.bat"
      PYTHON_VERSION: 3.6
    - PYTHON: "C:\\Miniconda35\\Scripts\\activate.bat"
      PYTHON_VERSION: 3.5
    - PYTHON: "C:\\Miniconda36\\Scripts\\activate.bat"

matrix:
  exclude:
    - PYTHON: "C:\\Miniconda35-x64\\Scripts\\activate.bat"
      platform: x86
    - PYTHON: "C:\\Miniconda36-x64\\Scripts\\activate.bat"
      platform: x86
    - PYTHON: "C:\\Miniconda35\\Scripts\\activate.bat"
      platform: x64
    - PYTHON: "C:\\Miniconda36\\Scripts\\activate.bat"
      platform: x64

configuration:
  - Release

install:
  - cmd: call %PYTHON%
  - cmd: conda config --set always_yes yes --set changeps1 no
  - cmd: conda update -q conda
  - cmd: conda install conda-build anaconda-client
  - cmd: conda create -q -n test_env python=%PYTHON_VERSION%
  - cmd: activate test_env
  - cmd: conda config --add channels conda-forge
  - cmd: conda install -c conda-forge pvl protobuf gdal numpy pandas sqlalchemy pyyaml networkx affine h5py scipy
  - cmd: conda install -c conda-forge pytest pytest-cov
  # https://pythonhosted.org/CodeChat/appveyor.yml.html
  - cmd: python -m pip install -U pip
  - cmd: python -m easy_install -U setuptools

build_script:
  - cmd: python setup.py install

test_script:
  - cmd: pytest plio/

on_success:
  - cmd: deactivate
  - cmd: conda config --set anaconda_upload yes
  - cmd: conda build --token %CONDA_UPLOAD_TOKEN% .
