-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
97 lines (87 loc) · 2.56 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 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
trigger:
- main
strategy:
matrix:
lin-Python27:
image.name: "ubuntu-latest"
python.version: "2.7"
lin-Python37:
image.name: "ubuntu-latest"
python.version: "3.7"
lin-Python38:
image.name: "ubuntu-latest"
python.version: "3.8"
lin-Python39:
image.name: "ubuntu-latest"
python.version: "3.9"
lin-Python310:
image.name: "ubuntu-latest"
python.version: "3.10"
lin-Python311:
image.name: "ubuntu-latest"
python.version: "3.11"
mac-Python37:
image.name: "macOS-latest"
python.version: "3.7"
mac-Python38:
image.name: "macOS-latest"
python.version: "3.8"
mac-Python39:
image.name: "macOS-latest"
python.version: "3.9"
mac-Python310:
image.name: "macOS-latest"
python.version: "3.10"
mac-Python311:
image.name: "macOS-latest"
python.version: "3.11"
win-Python37:
image.name: "windows-latest"
python.version: "3.7"
win-Python38:
image.name: "windows-latest"
python.version: "3.8"
win-Python39:
image.name: "windows-latest"
python.version: "3.9"
win-Python310:
image.name: "windows-latest"
python.version: "3.10"
win-Python311:
image.name: "windows-latest"
python.version: "3.11"
pool:
vmImage: $(image.name)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
githubToken: "$(GitHub_Personal_Access_Token)"
displayName: "Use Python $(python.version)"
- script: |
python -m pip install --upgrade pip
displayName: "Install dependencies"
- script: |
pip install yapf==0.31.0
yapf -d -r .
displayName: "Format with yapf"
- script: |
pip install flake8
flake8 . --count --show-source --statistics
displayName: "Lint with flake8"
- script: |
pip install pytest-azurepipelines pytest-cov
pytest --cov=. --cov-branch --cov-report=xml --test-run-title="$(Agent.JobName)"
displayName: "pytest"
- script: coverage report
displayName: "Print coverage report"
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"
condition: succeededOrFailed()