Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Python example Azure Pipeline
trigger:
- azure-pipelines
- master
jobs:
- job: Ubuntu_testing
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#pool
pool:
vmImage: "ubuntu-16.04"
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: python -m pip install --upgrade pip
displayName: "Upgrade pip"
- script: |
# commands run within the step
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
pip install pytest pytest-azurepipelines
python -m pytest tests/
displayName: 'Test with pytest'
#- script: |
# python -m pip install pylint --quiet
# pylint boston/*.py
# pylint iris/*.py
# displayName: 'Run lint tests'
- job: Windows_unit_test
pool:
vmImage: 'windows-2019'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
displayName: 'Get Python version $(python.version)'
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip
displayName: "Upgrade pip"
- script: |
# commands run within the step
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
pip install pytest pytest-azurepipelines
python -m pytest tests/
displayName: 'Test with pytest'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.