jobs:
- job: Windows_CI
  displayName: 'Windows CI'
  pool:
    #vmImage: 'vs2015-win2012r2'
    vmImage: 'vs2017-win2016'
  strategy:
    matrix: 
      Py36_x86:
        python.version: '3.6'
        python.arch: x86
        addToPath: true
      Py37_x86:
        python.version: '3.7'
        python.arch: x86
        addToPath: true
      Py36_x64:
        python.version: '3.6'
        python.arch: x64
        addToPath: true
      Py37_x64:
        python.version: '3.7'
        python.arch: x64
        addToPath: true
    maxParallel: 4

# Py38_x86:
#   python.version: '3.8'
#   python.arch: x86
#   addToPath: true
# Py38_x64:
#   python.version: '3.8'
#   python.arch: x64
#   addToPath: true


  variables: {'PYTHONUNBUFFERED': '1'}

  steps:
  - checkout: self
    submodules: recursive

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

  - bash: |
      which python
      python -c "import sys; print(sys.version); print(sys.prefix)"
    displayName: 'Check Python'

  - bash: |
      curl -O https://bootstrap.pypa.io/get-pip.py
      python get-pip.py
      python -m pip install -U setuptools wheel 
      python -m pip install -r requirements.txt
    displayName: 'Install Python dependencies'

  - bash: |
      which cl.exe
      python build.py --jobs=4 build_wx
    displayName: 'build wxWidgets'

  - bash: |
      python build.py dox etg --nodoc sip
    displayName: 'generate code'

  - bash: |
      python build.py --jobs=4 build_py
    displayName: 'build wxPython'

  - bash: |
      python build.py bdist_wheel
      python build.py install
      python -c "import wx; print(wx.version());"
    displayName: 'build wheel and test install'
