1
+ name : $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
2
+
3
+ variables :
4
+ " System.PreferGit " : true
5
+ PYTEST_ADDOPTS : " -vv -ra --showlocals"
6
+
7
+ trigger :
8
+ batch : true
9
+ branches :
10
+ include :
11
+ - master
12
+ - refs/tags/*
13
+ paths :
14
+ exclude :
15
+ - LICENSE.txt
16
+ - HOWTORELEASE.rst
17
+ - AUTHORS.txt
18
+ - CONTRIBUTING.rst
19
+ - .gitignore
20
+ - .github/*
21
+
22
+ jobs :
23
+ - template : azure-run-tox-env.yml
24
+ parameters : {tox: docs, python: 3.7}
25
+ - template : azure-run-tox-env.yml
26
+ parameters : {tox: package_readme, python: 3.7}
27
+
28
+ - template : azure-run-tox-env.yml
29
+ parameters : {tox: pypy, python: pypy, os: linux}
30
+ - template : azure-run-tox-env.yml
31
+ parameters : {tox: pypy3, python: pypy3, os: linux}
32
+
33
+ - template : azure-run-tox-env.yml
34
+ parameters : {tox: py37, python: 3.7, os: windows}
35
+ - template : azure-run-tox-env.yml
36
+ parameters : {tox: py36, python: 3.6, os: windows}
37
+ - template : azure-run-tox-env.yml
38
+ parameters : {tox: py35, python: 3.5, os: windows}
39
+ - template : azure-run-tox-env.yml
40
+ parameters : {tox: py34, python: 3.4, os: windows}
41
+ - template : azure-run-tox-env.yml
42
+ parameters : {tox: py27, python: 2.7, os: windows}
43
+
44
+ - template : azure-run-tox-env.yml
45
+ parameters : {tox: py37, python: 3.7, os: linux}
46
+ - template : azure-run-tox-env.yml
47
+ parameters : {tox: py36, python: 3.6, os: linux}
48
+ - template : azure-run-tox-env.yml
49
+ parameters : {tox: py35, python: 3.5, os: linux}
50
+ - template : azure-run-tox-env.yml
51
+ parameters : {tox: py34, python: 3.4, os: linux}
52
+ - template : azure-run-tox-env.yml
53
+ parameters : {tox: py27, python: 2.7, os: linux}
54
+
55
+ - template : azure-run-tox-env.yml
56
+ parameters : {tox: py36, python: 3.6, os: macOs}
57
+ - template : azure-run-tox-env.yml
58
+ parameters : {tox: py27, python: 2.7, os: macOs}
59
+
60
+ - job : report_coverage
61
+ pool : {vmImage: 'Ubuntu 16.04'}
62
+ condition : eq(variables['system.pullrequest.isfork'], false)
63
+ dependsOn :
64
+ - windows_py37
65
+ - windows_py36
66
+ - windows_py35
67
+ - windows_py34
68
+ - windows_py27
69
+ - linux_py37
70
+ - linux_py36
71
+ - linux_py35
72
+ - linux_py34
73
+ - linux_py27
74
+ - linux_pypy3
75
+ - linux_pypy
76
+ - macOS_py36
77
+ - macOS_py27
78
+ steps :
79
+ - task : DownloadBuildArtifacts@0
80
+ displayName : download coverage files for run
81
+ inputs :
82
+ buildType : current
83
+ downloadType : specific
84
+ itemPattern : coverage-*/*
85
+ downloadPath : $(Build.StagingDirectory)
86
+
87
+ - task : UsePythonVersion@0
88
+ displayName : setup python
89
+ inputs :
90
+ versionSpec : 3.7
91
+
92
+ - script : |
93
+ python -c '
94
+ from pathlib import Path
95
+ import shutil
96
+
97
+ from_folder = Path("$(Build.StagingDirectory)")
98
+ destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox"
99
+ destination_folder.mkdir()
100
+ for coverage_file in from_folder.glob("*/.coverage"):
101
+ destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}"
102
+ print(f"{coverage_file} copy to {destination}")
103
+ shutil.copy(str(coverage_file), str(destination))'
104
+ displayName: move coverage files into .tox
105
+
106
+ - script : ' python -m pip install -U tox --pre'
107
+ displayName : install tox
108
+
109
+ - script : ' python -m tox -e coverage'
110
+ displayName : create coverag report via tox
111
+
112
+ - task : PublishCodeCoverageResults@1
113
+ displayName : publish overall coverage report to Azure
114
+ inputs :
115
+ codeCoverageTool : ' cobertura'
116
+ summaryFileLocation : ' $(System.DefaultWorkingDirectory)/.tox/coverage.xml'
117
+ reportDirectory : ' $(System.DefaultWorkingDirectory)/.tox/htmlcov'
118
+ failIfCoverageEmpty : true
0 commit comments