image: Visual Studio 2019
environment:

  CONDA_PATH: "C:\\Miniconda"

  matrix:
    - PYTHON_VERSION: "3.7"
    - PYTHON_VERSION: "3.8"

platform:
    - x64

install:
  # Use the pre-installed Miniconda for the desired arch
  - ps: if($env:PYTHON_VERSION -eq '3.7')
            { $env:CONDA_PATH="$($env:CONDA_PATH)37" }
  - ps: if($env:PLATFORM -eq 'x64')
          { $env:CONDA_PATH="$($env:CONDA_PATH)-x64" }
  - ps: $env:path="$($env:CONDA_PATH);$($env:CONDA_PATH)\Scripts;$($env:CONDA_PATH)\Library\bin;$($env:PATH)"
  # Debugging
  #- "SET PATH"
  #- "python --version"
  #- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
  #- "conda info"
  #- "conda list"

  # Create and activate a conda environment with the desired Python version
  - cmd: conda update --yes --quiet conda
  - cmd: conda config --set changeps1 no
  - cmd: conda config --add channels conda-forge
  - cmd: conda config --add channels conda-forge

  # Install Py-ART dependecies
  - cmd: conda create -y -q -n matrix_env python=%PYTHON_VERSON% numpy scipy matplotlib netcdf4 pytest pytest-cov cython cartopy xarray
  - cmd: activate matrix_env

  # Check that we have the expected version and architecture for Python
  # in the conda environment
  - cmd: python --version
  - cmd: python -c "import struct; print(struct.calcsize('P') * 8)"
  - cmd: conda list

  # build Py-ART
  - cmd: pip install -e .

build: false

test_script:
  # run the unit tests
  - cmd: pytest -v --cov pyart
