trigger:
  batch: false
  branches:
    include:
      - master
      - maint
      - ci/all
      - ci/azure

jobs:

- job: Linux
  pool:
    vmImage: 'Ubuntu-18.04'
  strategy:
    matrix:
      Python35_MPICH:
        PYTHON_VERSION: '3.5'
        MPI: 'mpich'
      Python35_OpenMPI:
        PYTHON_VERSION: '3.5'
        MPI: 'openmpi'
      Python36_MPICH:
        PYTHON_VERSION: '3.6'
        MPI: 'mpich'
      Python36_OpenMPI:
        PYTHON_VERSION: '3.6'
        MPI: 'openmpi'
      Python37_MPICH:
        PYTHON_VERSION: '3.7'
        MPI: 'mpich'
      Python37_OpenMPI:
        PYTHON_VERSION: '3.7'
        MPI: 'openmpi'
      Python38_MPICH:
        PYTHON_VERSION: '3.8'
        MPI: 'mpich'
      Python38_OpenMPI:
        PYTHON_VERSION: '3.8'
        MPI: 'openmpi'
      Python39_MPICH:
        PYTHON_VERSION: '3.9'
        MPI: 'mpich'
      Python39_OpenMPI:
        PYTHON_VERSION: '3.9'
        MPI: 'openmpi'
      Python310_MPICH:
        PYTHON_VERSION: '3.10'
        MPI: 'mpich'
      Python310_OpenMPI:
        PYTHON_VERSION: '3.10'
        MPI: 'openmpi'
  variables:
    PYTHON_ARCH: x64
  steps:
  - bash: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
    displayName: 'Configure hostname'
  - template: steps.yml

- job: macOS
  pool:
    vmImage: 'macOS-10.15'
  strategy:
    matrix:
      Python35_MPICH:
        PYTHON_VERSION: '3.5'
        MPI: 'mpich'
      Python35_OpenMPI:
        PYTHON_VERSION: '3.5'
        MPI: 'openmpi'
      Python36_MPICH:
        PYTHON_VERSION: '3.6'
        MPI: 'mpich'
      Python36_OpenMPI:
        PYTHON_VERSION: '3.6'
        MPI: 'openmpi'
      Python37_MPICH:
        PYTHON_VERSION: '3.7'
        MPI: 'mpich'
      Python37_OpenMPI:
        PYTHON_VERSION: '3.7'
        MPI: 'openmpi'
      Python38_MPICH:
        PYTHON_VERSION: '3.8'
        MPI: 'mpich'
      Python38_OpenMPI:
        PYTHON_VERSION: '3.8'
        MPI: 'openmpi'
      Python39_MPICH:
        PYTHON_VERSION: '3.9'
        MPI: 'mpich'
      Python39_OpenMPI:
        PYTHON_VERSION: '3.9'
        MPI: 'openmpi'
      Python310_MPICH:
        PYTHON_VERSION: '3.10'
        MPI: 'mpich'
      Python310_OpenMPI:
        PYTHON_VERSION: '3.10'
        MPI: 'openmpi'
  variables:
    PYTHON_ARCH: x64
  steps:
  - bash: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
    displayName: 'Configure hostname'
  - template: steps.yml

- job: Windows
  pool:
    vmImage: 'windows-2019'
  strategy:
    matrix:
      Python35_32bit:
        PYTHON_VERSION: '3.5'
        PYTHON_ARCH:    'x86'
      Python36_32bit:
        PYTHON_VERSION: '3.6'
        PYTHON_ARCH:    'x86'
      Python37_32bit:
        PYTHON_VERSION: '3.7'
        PYTHON_ARCH:    'x86'
      Python38_32bit:
        PYTHON_VERSION: '3.8'
        PYTHON_ARCH:    'x86'
      Python39_32bit:
        PYTHON_VERSION: '3.9'
        PYTHON_ARCH:    'x86'
      Python35_64bit:
        PYTHON_VERSION: '3.5'
        PYTHON_ARCH:    'x64'
      Python36_64bit:
        PYTHON_VERSION: '3.6'
        PYTHON_ARCH:    'x64'
      Python37_64bit:
        PYTHON_VERSION: '3.7'
        PYTHON_ARCH:    'x64'
      Python38_64bit:
        PYTHON_VERSION: '3.8'
        PYTHON_ARCH:    'x64'
      Python39_64bit:
        PYTHON_VERSION: '3.9'
        PYTHON_ARCH:    'x64'
      Python310_64bit:
        PYTHON_VERSION: '3.10'
        PYTHON_ARCH:    'x64'
  variables:
    MPI: 'msmpi'
  steps:
  - template: steps.yml
  - publish: dist
    artifact: 'Windows-py$(PYTHON_VERSION)-$(PYTHON_ARCH)'
    displayName: 'Publish package artifacts'
    condition: eq( variables['Agent.OS'], 'Windows_NT' )
