|
| 1 | +name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr) |
| 2 | + |
| 3 | +trigger: |
| 4 | + branches: |
| 5 | + include: |
| 6 | + - '*' |
| 7 | + |
| 8 | +phases: |
| 9 | +- phase: lint |
| 10 | + queue: |
| 11 | + name: 'Hosted Linux Preview' |
| 12 | + |
| 13 | + steps: |
| 14 | + - task: UsePythonVersion@0 |
| 15 | + displayName: setup python |
| 16 | + inputs: |
| 17 | + versionSpec: '3.7.0-b2' |
| 18 | + |
| 19 | + - script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"' |
| 20 | + displayName: link python to python3.7 |
| 21 | + |
| 22 | + - script: 'python -m pip install -U tox setuptools' |
| 23 | + displayName: install tox |
| 24 | + |
| 25 | + - script: 'tox -e fix-lint' |
| 26 | + displayName: run tox |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +- phase: docs |
| 31 | + queue: |
| 32 | + name: 'Hosted Linux Preview' |
| 33 | + parallel: 2 |
| 34 | + matrix: |
| 35 | + readthedocs: |
| 36 | + toxenv: 'docs' |
| 37 | + packageDescription: |
| 38 | + toxenv: 'package-description' |
| 39 | + |
| 40 | + steps: |
| 41 | + - task: UsePythonVersion@0 |
| 42 | + displayName: setup python |
| 43 | + inputs: |
| 44 | + versionSpec: '3.7.0-b2' |
| 45 | + |
| 46 | + - script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"' |
| 47 | + displayName: link python to python3.7 |
| 48 | + |
| 49 | + - script: 'python -m pip install -U tox setuptools' |
| 50 | + displayName: install tox |
| 51 | + |
| 52 | + - script: 'tox -e $(toxenv)' |
| 53 | + displayName: run tox |
| 54 | + |
| 55 | +- phase: linux |
| 56 | + queue: |
| 57 | + name: 'Hosted Linux Preview' |
| 58 | + parallel: 4 |
| 59 | + matrix: |
| 60 | + python27: |
| 61 | + python.version: '2.7' |
| 62 | + python34: |
| 63 | + python.version: '3.4' |
| 64 | + python35: |
| 65 | + python.version: '3.5' |
| 66 | + python36: |
| 67 | + python.version: '3.6' |
| 68 | + python37: |
| 69 | + python.version: '3.7.0-b2' |
| 70 | + |
| 71 | + steps: |
| 72 | + - task: UsePythonVersion@0 |
| 73 | + displayName: setup python$(python.version) |
| 74 | + inputs: |
| 75 | + versionSpec: '$(python.version)' |
| 76 | + |
| 77 | + - script: 'python -m pip install -U tox setuptools' |
| 78 | + displayName: install tox |
| 79 | + |
| 80 | + - script: 'python -m tox -e py --notest' |
| 81 | + displayName: acquire env dependencies |
| 82 | + |
| 83 | + - script: 'python -m tox -e py' |
| 84 | + displayName: run tests |
| 85 | + |
| 86 | + - task: PublishTestResults@2 |
| 87 | + displayName: publish test results |
| 88 | + inputs: |
| 89 | + testResultsFiles: '.tox/test-results.*.xml' |
| 90 | + mergeTestResults: true |
| 91 | + testRunTitle: '$(toxenv)' |
| 92 | + platform: linux |
| 93 | + |
| 94 | + - script: 'python -m tox -e coverage' |
| 95 | + displayName: generate coverage.xml |
| 96 | + |
| 97 | + - script: 'ls . -Ra' |
| 98 | + displayName: show |
| 99 | + |
| 100 | + - task: PublishCodeCoverageResults@1 |
| 101 | + inputs: |
| 102 | + codeCoverageTool: 'cobertura' |
| 103 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml' |
| 104 | + failIfCoverageEmpty: true |
| 105 | + |
| 106 | + - script: 'python -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-$(python.version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=$(python.version)' |
| 107 | + displayName: upload codecov |
| 108 | + |
| 109 | +- phase: windows |
| 110 | + queue: |
| 111 | + name: 'Hosted VS2017' |
| 112 | + parallel: 4 |
| 113 | + matrix: |
| 114 | + python27: |
| 115 | + python.version: '2.7' |
| 116 | + python34: |
| 117 | + python.version: '3.4' |
| 118 | + python35: |
| 119 | + python.version: '3.5' |
| 120 | + python36: |
| 121 | + python.version: '3.6' |
| 122 | + python37: |
| 123 | + python.version: '3.7.0-b2' |
| 124 | + |
| 125 | + steps: |
| 126 | + - task: UsePythonVersion@0 |
| 127 | + displayName: setup python$(python.version) |
| 128 | + inputs: |
| 129 | + versionSpec: '$(python.version)' |
| 130 | + |
| 131 | + - script: 'python -m pip install -U tox setuptools' |
| 132 | + displayName: install tox |
| 133 | + |
| 134 | + - script: 'python -m tox -e py --notest' |
| 135 | + displayName: acquire env dependencies |
| 136 | + |
| 137 | + - script: 'python -m tox -e py' |
| 138 | + displayName: run tests |
| 139 | + |
| 140 | + - task: PublishTestResults@2 |
| 141 | + displayName: publish test results |
| 142 | + inputs: |
| 143 | + testResultsFiles: '.tox/test-results.*.xml' |
| 144 | + mergeTestResults: true |
| 145 | + testRunTitle: '$(toxenv)' |
| 146 | + platform: windows |
| 147 | + |
| 148 | + - script: 'python -m tox -e coverage' |
| 149 | + displayName: generate coverage.xml |
| 150 | + |
| 151 | + - task: PublishCodeCoverageResults@1 |
| 152 | + inputs: |
| 153 | + codeCoverageTool: 'cobertura' |
| 154 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml' |
| 155 | + failIfCoverageEmpty: true |
| 156 | + |
| 157 | + - script: 'python -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-$(python.version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=$(python.version)' |
| 158 | + displayName: upload codecov |
| 159 | + |
| 160 | +- phase: macOS |
| 161 | + queue: |
| 162 | + name: 'Hosted macOS Preview' |
| 163 | + parallel: 1 |
| 164 | + matrix: |
| 165 | + python: |
| 166 | + toxenv: 'py3' |
| 167 | + |
| 168 | + steps: |
| 169 | + - script: 'python3 -m pip install -U tox setuptools' |
| 170 | + displayName: install tox |
| 171 | + |
| 172 | + - script: 'python3 -m tox -e $(toxenv) --notest' |
| 173 | + displayName: acquire env dependencies |
| 174 | + |
| 175 | + - script: 'python3 -m tox -e $(toxenv)' |
| 176 | + displayName: run tests |
| 177 | + |
| 178 | + - task: PublishTestResults@2 |
| 179 | + displayName: publish test results |
| 180 | + inputs: |
| 181 | + testResultsFiles: '.tox/test-results.*.xml' |
| 182 | + mergeTestResults: true |
| 183 | + testRunTitle: '$(toxenv)' |
| 184 | + platform: windows |
| 185 | + |
| 186 | + - script: 'python3 -m tox -e coverage' |
| 187 | + displayName: generate coverage.xml |
| 188 | + |
| 189 | + - task: PublishCodeCoverageResults@1 |
| 190 | + inputs: |
| 191 | + codeCoverageTool: 'cobertura' |
| 192 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml' |
| 193 | + failIfCoverageEmpty: true |
| 194 | + |
| 195 | + - script: 'python3 -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-python3" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=3' |
| 196 | + displayName: upload codecov |
| 197 | + |
| 198 | +- phase: publish |
| 199 | + dependsOn: |
| 200 | + - macOs |
| 201 | + - linux |
| 202 | + - windows |
| 203 | + - lint |
| 204 | + - docs |
| 205 | + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
| 206 | + queue: |
| 207 | + name: 'Hosted Linux Preview' |
| 208 | + parallel: 1 |
| 209 | + matrix: |
| 210 | + python37: |
| 211 | + python.version: '3.7.0-b2' |
| 212 | + |
| 213 | + steps: |
| 214 | + - task: UsePythonVersion@0 |
| 215 | + displayName: setup python$(python.version) |
| 216 | + inputs: |
| 217 | + versionSpec: '$(python.version)' |
| 218 | + |
| 219 | +# - task: PyPIPublisher@0 |
| 220 | +# displayName: Package and publish to PyPI |
| 221 | +# inputs: |
| 222 | +# pypiConnection: pypi |
| 223 | +# packageDirectory: '$(System.DefaultWorkingDirectory)' |
| 224 | +# alsoPublishWheel: true |
0 commit comments