1+ # Variables:
2+ # 'codecov-storage-repository-token' Is the codecov.io repository token.
3+
4+ trigger :
5+ - master
6+
7+ jobs :
8+ - job : ' Build_Packages'
9+
10+ pool :
11+ vmImage : ' ubuntu-16.04'
12+
13+ steps :
14+ - task : UsePythonVersion@0
15+ displayName : ' Use Python 3.6'
16+ inputs :
17+ versionSpec : 3.6
18+
19+ - script : |
20+ pip install wheel setuptools
21+ displayName: 'Prep Environment'
22+
23+ - script : |
24+ python ./azure-storage-common/setup.py sdist bdist_wheel -d $(Build.ArtifactStagingDirectory)
25+ python ./azure-storage-blob/setup.py sdist bdist_wheel -d $(Build.ArtifactStagingDirectory)
26+ python ./azure-storage-file/setup.py sdist bdist_wheel -d $(Build.ArtifactStagingDirectory)
27+ python ./azure-storage-queue/setup.py sdist bdist_wheel -d $(Build.ArtifactStagingDirectory)
28+ displayName: 'Generate Packages'
29+
30+ - task : PublishBuildArtifacts@1
31+ displayName : ' Publish Artifacts'
32+ condition : succeededOrFailed()
33+
34+
35+ - job : ' Tests'
36+ dependsOn :
37+ - ' Build_Packages'
38+ strategy :
39+ matrix :
40+ Linux_Python27 :
41+ os.name : ' Linux'
42+ os.vmImage : ' ubuntu-16.04'
43+ python.version : ' 2.7'
44+ Linux_Python34 :
45+ os.name : ' Linux'
46+ os.vmImage : ' ubuntu-16.04'
47+ python.version : ' 3.4'
48+ Linux_Python35 :
49+ os.name : ' Linux'
50+ os.vmImage : ' ubuntu-16.04'
51+ python.version : ' 3.5'
52+ Linux_Python36 :
53+ os.name : ' Linux'
54+ os.vmImage : ' ubuntu-16.04'
55+ python.version : ' 3.6'
56+ Linux_Python37 :
57+ os.name : ' Linux'
58+ os.vmImage : ' ubuntu-16.04'
59+ python.version : ' 3.7'
60+ Windows_Python27 :
61+ os.name : ' Windows'
62+ os.vmImage : ' vs2017-win2016'
63+ python.version : ' 2.7'
64+ Windows_Python36 :
65+ os.name : ' Windows'
66+ os.vmImage : ' vs2017-win2016'
67+ python.version : ' 3.6'
68+ Windows_Python37 :
69+ os.name : ' Windows'
70+ os.vmImage : ' vs2017-win2016'
71+ python.version : ' 3.7'
72+ MacOS_Python27 :
73+ os.name : ' MacOS'
74+ os.vmImage : ' macOS-10.13'
75+ python.version : ' 2.7'
76+ pool :
77+ vmImage : ' $(os.vmImage)'
78+
79+ steps :
80+ - task : UsePythonVersion@0
81+ displayName : ' Use Python $(python.version)'
82+ inputs :
83+ versionSpec : ' $(python.version)'
84+
85+ - script : |
86+ pip install -U pip
87+ pip install codecov
88+ pip install coverage
89+ pip install -r requirements.txt
90+ pip install -e azure-storage-common
91+ pip install -e azure-storage-blob
92+ pip install -e azure-storage-file
93+ pip install -e azure-storage-queue
94+ displayName: 'Prep Environment'
95+ enabled: false
96+
97+ - script : |
98+ pip install -e azure-storage-nspkg
99+ displayName: 'Install nspkg'
100+ condition: eq('2.7', variables['python.version'])
101+ enabled: false
102+
103+ - script : |
104+ coverage run -m unittest discover
105+ displayName: 'Run Tests'
106+ enabled: false
107+
108+ - script : |
109+ coverage report
110+ coverage xml
111+ displayName: 'Generate Coverage'
112+ enabled: false
113+
114+ - script : |
115+ codecov -t $(codecov-storage-repository-token)
116+ enabled: false
117+ displayName: 'Publish Coverage to Codecov.io'
118+ condition: ne(variables['codecov-storage-repository-token'], '')
119+
120+ - task : PublishCodeCoverageResults@1
121+ enabled : false
122+ displayName : ' Publish Coverage to DevOps'
123+ inputs :
124+ codeCoverageTool : Cobertura
125+ summaryFileLocation : ' $(Build.SourcesDirectory)/coverage.xml'
126+
127+ - job : Test_PyPy3
128+ continueOnError : true
129+ timeoutInMinutes : 90
130+ dependsOn :
131+ - ' Build_Packages'
132+ pool :
133+ vmImage : ' ubuntu-16.04'
134+ steps :
135+ - task : UsePythonVersion@0
136+ displayName : ' Use Python 3.6 For Build Tools'
137+ inputs :
138+ versionSpec : ' 3.6'
139+
140+ - script : |
141+ cd ~/
142+ wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2
143+ tar xf pypy3-v6.0.0-linux64.tar.bz2
144+
145+ cd $(Build.SourcesDirectory)
146+
147+ PATH=/home/vsts/pypy3-v6.0.0-linux64/bin/:$PATH
148+ pypy3 -m ensurepip
149+ pypy3 -m pip install codecov
150+ pypy3 -m pip install coverage
151+ pypy3 -m pip install -r requirements.txt
152+ pypy3 -m pip install -e azure-storage-common
153+ pypy3 -m pip install -e azure-storage-blob
154+ pypy3 -m pip install -e azure-storage-file
155+ pypy3 -m pip install -e azure-storage-queue
156+ pypy3 -m coverage run -m unittest discover
157+ displayName: 'Setup and Run Tests PyPy3'
0 commit comments