# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

jobs:

- job: 'MitogenTests'
  pool:
    vmImage: 'Ubuntu 16.04'
  strategy:
    matrix:
      Mitogen27Debian_27:
        python.version: '2.7'
        MODE: mitogen
        DISTRO: debian

      MitogenPy27CentOS6_26:
        python.version: '2.7'
        MODE: mitogen
        DISTRO: centos6

      #Py26CentOS7:
        #python.version: '2.7'
        #MODE: mitogen
        #DISTRO: centos6

      Mitogen36CentOS6_26:
        python.version: '3.6'
        MODE: mitogen
        DISTRO: centos6

      DebOps_2460_27_27:
        python.version: '2.7'
        MODE: debops_common
        VER: 2.4.6.0

      DebOps_262_36_27:
        python.version: '3.6'
        MODE: debops_common
        VER: 2.6.2

      Ansible_2460_26:
        python.version: '2.7'
        MODE: ansible
        VER: 2.4.6.0

      Ansible_262_26:
        python.version: '2.7'
        MODE: ansible
        VER: 2.6.2

      Ansible_2460_36:
        python.version: '3.6'
        MODE: ansible
        VER: 2.4.6.0

      Ansible_262_36:
        python.version: '3.6'
        MODE: ansible
        VER: 2.6.2

      Vanilla_262_27:
        python.version: '2.7'
        MODE: ansible
        VER: 2.6.2
        DISTROS: debian
        STRATEGY: linear

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
      architecture: 'x64'

  - script: .ci/prep_azure.py
    displayName: "Install requirements."

  - script: .ci/$(MODE)_install.py
    displayName: "Install requirements."

  - script: .ci/$(MODE)_tests.py
    displayName: Run tests.