-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathazure-pipelines.yml
81 lines (67 loc) · 2.32 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Azure pipeline for Python project
# for python docs https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/python?view=azure-devops
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#triggers
trigger:
- azure-pipelines
- master
stages:
- stage: simple_python_testing
displayName: 'Python matrix testing'
jobs:
- job: Ubuntu_unit_test
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#pool
pool:
vmImage: 'Ubuntu-16.04'
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: |
python -m pip install pylint --quiet
pylint boston/*.py
pylint iris/*.py
displayName: 'Run lint tests'
- script: |
pip install pytest pytest-azurepipelines
python -m pytest tests/
displayName: 'Test with pytest'
# let's test in Windows
- 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'