pr:
  autoCancel: true
  
jobs:

- job: 'Linux'
  timeoutInMinutes: 0
  pool:
    vmImage: 'ubuntu-latest'
  strategy:
    matrix:
      Python36:
        python.version: '3.6'
      Python37:
        python.version: '3.7'
      Python38:
        python.version: '3.8'

  steps:
  - bash: |
      echo "##vso[task.prependpath]$CONDA/bin"
      hash -r
    displayName: Add conda to PATH
  - bash: |
      conda config --set always_yes yes --set changeps1 no
      conda info -a
      conda create -n hicmatrix --yes -c conda-forge -c bioconda python=$(python.version) --file requirements.txt
      source activate hicmatrix
      conda install --yes -c conda-forge -c bioconda pytest flake8 pytest-xdist pytest-forked
      conda install --yes -c conda-forge -c bioconda nose
      conda install --yes pathlib
      conda install --yes -c defaults -c conda-forge -c bioconda configparser
      python setup.py install
    displayName: installing dependencies
  - script: |
      source activate hicmatrix
      flake8 . --exclude=.venv,.build,planemo_test_env,build --ignore=E501,F401,F403,E402,F999,F405,E712
    displayName: linting
  - script: |
      source activate hicmatrix
      py.test hicmatrix/test/ --capture=sys
    displayName: pytest

- job: 'OSX'
  timeoutInMinutes: 0
  pool:
    vmImage: 'macOS-10.14'
  strategy:
    matrix:
      Python36:
        python.version: '3.6'
      Python37:
        python.version: '3.7'
      Python38:
        python.version: '3.8'

  steps:
  - bash: |
      echo "##vso[task.prependpath]$CONDA/bin"
      hash -r
    displayName: Add conda to PATH
  - bash: |
      conda config --set always_yes yes --set changeps1 no
      conda info -a
      conda create -n hicmatrix --yes -c conda-forge -c bioconda python=$(python.version) --file requirements.txt
      source activate hicmatrix
      conda install --yes -c conda-forge -c bioconda pytest flake8 pytest-xdist pytest-forked
      conda install --yes -c conda-forge -c bioconda nose
      conda install --yes pathlib
      conda install --yes -c defaults -c conda-forge -c bioconda configparser
      python setup.py install
    displayName: installing dependencies
  - script: |
      source activate hicmatrix
      flake8 . --exclude=.venv,.build,planemo_test_env,build --ignore=E501,F401,F403,E402,F999,F405,E712
    displayName: linting
  - script: |
      source activate hicmatrix
      py.test hicmatrix/test/ --capture=sys
    displayName: pytest
