@@ -24,62 +24,136 @@ trigger:
24
24
25
25
jobs :
26
26
- template : azure-run-tox-env.yml
27
- parameters : {name: check_code_style, tox: "fix-lint ", python: ' 3.7', image: 'Ubuntu 16.04' }
27
+ parameters : {tox: "fix_lint ", python: " 3.7" }
28
28
- template : azure-run-tox-env.yml
29
- parameters : {name: generate_docs, tox: docs, python: ' 3.7', image: 'Ubuntu 16.04' }
29
+ parameters : {tox: " docs" , python: " 3.7" }
30
30
- template : azure-run-tox-env.yml
31
- parameters : {name: check_package_long_description, tox: "package-description ", python: ' 3.7', image: 'Ubuntu 16.04' }
31
+ parameters : {tox: "package_description ", python: " 3.7" }
32
32
33
33
- template : azure-run-tox-env.yml
34
- parameters : {name: windows_37 , python: ' 3.7', image: 'vs2017-win2016' }
34
+ parameters : {tox: "py37" , python: " 3.7", os: "windows" }
35
35
- template : azure-run-tox-env.yml
36
- parameters : {name: windows_36 , python: ' 3.6', image: 'vs2017-win2016' }
36
+ parameters : {tox: "py36" , python: " 3.6", os: "windows" }
37
37
- template : azure-run-tox-env.yml
38
- parameters : {name: windows_35 , python: ' 3.5', image: 'vs2017-win2016' }
38
+ parameters : {tox: "py35" , python: " 3.5", os: "windows" }
39
39
- template : azure-run-tox-env.yml
40
- parameters : {name: windows_34 , python: ' 3.4', image: 'vs2017-win2016' }
40
+ parameters : {tox: "py34" , python: " 3.4", os: "windows" }
41
41
- template : azure-run-tox-env.yml
42
- parameters : {name: windows_27 , python: ' 2.7', image: 'vs2017-win2016' }
42
+ parameters : {tox: "py27" , python: " 2.7", os: "windows" }
43
43
44
44
- template : azure-run-tox-env.yml
45
- parameters : {name: linux_37 , python: ' 3.7', image: 'Ubuntu 16.04' }
45
+ parameters : {tox: "py37" , python: " 3.7", os: "linux" }
46
46
- template : azure-run-tox-env.yml
47
- parameters : {name: linux_36 , python: ' 3.6', image: 'Ubuntu 16.04' }
47
+ parameters : {tox: "py36" , python: " 3.6", os: "linux" }
48
48
- template : azure-run-tox-env.yml
49
- parameters : {name: linux_35 , python: ' 3.5', image: 'Ubuntu 16.04' }
49
+ parameters : {tox: "py35" , python: " 3.5", os: "linux" }
50
50
- template : azure-run-tox-env.yml
51
- parameters : {name: linux_34 , python: ' 3.4', image: 'Ubuntu 16.04' }
51
+ parameters : {tox: "py34" , python: " 3.4", os: "linux" }
52
52
- template : azure-run-tox-env.yml
53
- parameters : {name: linux_27 , python: ' 2.7', image: 'Ubuntu 16.04' }
53
+ parameters : {tox: "py27" , python: " 2.7", os: "linux" }
54
54
55
55
- template : azure-run-tox-env.yml
56
- parameters : {name: macOS_36, python: '3.6', image: 'macOS 10.13'}
56
+ parameters : {tox: "pypy", python: "pypy", os: "linux"}
57
+ - template : azure-run-tox-env.yml
58
+ parameters : {tox: "pypy3", python: "pypy3", os: "linux"}
59
+
60
+ - template : azure-run-tox-env.yml
61
+ parameters : {tox: "py36", python: "3.6", os: "macOs"}
57
62
58
- - job : tests_done
63
+ - job : report_coverage
59
64
pool : {vmImage: 'Ubuntu 16.04'}
60
- condition : always()
65
+ condition : and( always(), eq(variables['system.pullrequest.isfork'], false) )
61
66
dependsOn :
62
- - windows_37
63
- - windows_36
64
- - windows_35
65
- - windows_34
66
- - windows_27
67
- - linux_37
68
- - linux_36
69
- - linux_35
70
- - linux_34
71
- - linux_27
72
- - macOS_36
67
+ - windows_py37
68
+ - windows_py36
69
+ - windows_py35
70
+ - windows_py34
71
+ - windows_py27
72
+ - linux_py37
73
+ - linux_py36
74
+ - linux_py35
75
+ - linux_py34
76
+ - linux_py27
77
+ - linux_pypy3
78
+ - linux_pypy
79
+ - macOS_py36
73
80
steps :
74
- - script : echo "done"
75
- displayName : running tests done
81
+ - task : DownloadBuildArtifacts@0
82
+ displayName : download coverage files for run
83
+ inputs :
84
+ buildType : ' current'
85
+ downloadType : ' specific'
86
+ itemPattern : ' coverage-*/*'
87
+ downloadPath : ' $(Build.StagingDirectory)'
88
+
89
+ - task : UsePythonVersion@0
90
+ displayName : setup python
91
+ inputs :
92
+ versionSpec : ' 3.7'
93
+
94
+ - script : |
95
+ python -c '
96
+ from pathlib import Path
97
+ import shutil
98
+
99
+ from_folder = Path("$(Build.StagingDirectory)")
100
+ destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox"
101
+ destination_folder.mkdir()
102
+ for coverage_file in from_folder.glob("*/.coverage"):
103
+ destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}"
104
+ print(f"{coverage_file} copy to {destination}")
105
+ shutil.copy(str(coverage_file), str(destination))
106
+ '
107
+ displayName: move coverage files into .tox
108
+
109
+ - script : ' python -m pip install -U tox --pre'
110
+ displayName : install tox
111
+
112
+ - script : ' python -m tox -e py --sdistonly'
113
+ displayName : generate version.py
114
+
115
+ - script : ' python -m tox -e coverage'
116
+ displayName : create coverag report via tox
117
+
118
+ - task : PublishCodeCoverageResults@1
119
+ displayName : publish overall coverage report to Azure
120
+ inputs :
121
+ codeCoverageTool : ' cobertura'
122
+ summaryFileLocation : ' $(System.DefaultWorkingDirectory)/.tox/coverage.xml'
123
+ reportDirectory : ' $(System.DefaultWorkingDirectory)/.tox/htmlcov'
124
+ failIfCoverageEmpty : true
125
+
126
+ - script : |
127
+ python -c '
128
+ import textwrap
129
+
130
+ content = textwrap.dedent(
131
+ """
132
+ service_name: Azure Pipelines
133
+ service_pull_request: $(System.PullRequest.PullRequestNumber)
134
+ """
135
+ )
136
+ print(content)
137
+ with open(".coveralls.yml", "w") as file_handler:
138
+ file_handler.write(content)
139
+ '
140
+ displayName: create coveralls config
141
+
142
+ - script : ' python -m tox -e coveralls'
143
+ displayName : publish overall coverage report to coveralls
144
+ env :
145
+ CI_BRANCH : $(Build.SourceBranch)
146
+ COVERALLS_REPO_TOKEN : $(COVERALLS_REPO_TOKEN)
147
+ COVERALLS_PARALLEL : false
148
+ COVERALLS_FLAG_NAME : ${{ parameters.name }}
149
+
76
150
77
151
- job : publish
78
152
dependsOn :
79
- - tests_done
80
- - check_code_style
81
- - generate_docs
82
- - check_package_long_description
153
+ - report_coverage
154
+ - linux_fix_lint
155
+ - linux_docs
156
+ - linux_package_description
83
157
condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
84
158
pool : {vmImage: 'Ubuntu 16.04'}
85
159
steps :
0 commit comments