Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83c616d
commit 9d8d241
Showing
5 changed files
with
213 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr) | ||
|
||
variables: | ||
"System.PreferGit": true | ||
PYTEST_ADDOPTS: "-vv -ra --showlocals" | ||
|
||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- master | ||
- refs/tags/* | ||
paths: | ||
exclude: | ||
- LICENSE.txt | ||
- HOWTORELEASE.rst | ||
- AUTHORS.txt | ||
- CONTRIBUTING.rst | ||
- .gitignore | ||
- .github/* | ||
|
||
jobs: | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: docs, python: 3.7} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: package_readme, python: 3.7} | ||
|
||
- template: azure-run-tox-env.yml | ||
parameters: {tox: pypy, python: pypy, os: linux} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: pypy3, python: pypy3, os: linux} | ||
|
||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py37, python: 3.7, os: windows} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py36, python: 3.6, os: windows} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py35, python: 3.5, os: windows} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py34, python: 3.4, os: windows} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py27, python: 2.7, os: windows} | ||
|
||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py37, python: 3.7, os: linux} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py36, python: 3.6, os: linux} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py35, python: 3.5, os: linux} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py34, python: 3.4, os: linux} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py27, python: 2.7, os: linux} | ||
|
||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py36, python: 3.6, os: macOs} | ||
- template: azure-run-tox-env.yml | ||
parameters: {tox: py27, python: 2.7, os: macOs} | ||
|
||
- job: report_coverage | ||
pool: {vmImage: 'Ubuntu 16.04'} | ||
condition: eq(variables['system.pullrequest.isfork'], false) | ||
dependsOn: | ||
- windows_py37 | ||
- windows_py36 | ||
- windows_py35 | ||
- windows_py34 | ||
- windows_py27 | ||
- linux_py37 | ||
- linux_py36 | ||
- linux_py35 | ||
- linux_py34 | ||
- linux_py27 | ||
- linux_pypy3 | ||
- linux_pypy | ||
- macOS_py36 | ||
- macOS_py27 | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: download coverage files for run | ||
inputs: | ||
buildType: current | ||
downloadType: specific | ||
itemPattern: coverage-*/* | ||
downloadPath: $(Build.StagingDirectory) | ||
|
||
- task: UsePythonVersion@0 | ||
displayName: setup python | ||
inputs: | ||
versionSpec: 3.7 | ||
|
||
- script: | | ||
python -c ' | ||
from pathlib import Path | ||
import shutil | ||
from_folder = Path("$(Build.StagingDirectory)") | ||
destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox" | ||
destination_folder.mkdir() | ||
for coverage_file in from_folder.glob("*/.coverage"): | ||
destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}" | ||
print(f"{coverage_file} copy to {destination}") | ||
shutil.copy(str(coverage_file), str(destination))' | ||
displayName: move coverage files into .tox | ||
- script: 'python -m pip install -U tox --pre' | ||
displayName: install tox | ||
|
||
- script: 'python -m tox -e coverage' | ||
displayName: create coverag report via tox | ||
|
||
- task: PublishCodeCoverageResults@1 | ||
displayName: publish overall coverage report to Azure | ||
inputs: | ||
codeCoverageTool: 'cobertura' | ||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml' | ||
reportDirectory: '$(System.DefaultWorkingDirectory)/.tox/htmlcov' | ||
failIfCoverageEmpty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
parameters: | ||
tox: "" | ||
python: "" | ||
os: "linux" | ||
|
||
jobs: | ||
- job: ${{ format('{0}_{1}', parameters.os, parameters.tox) }} | ||
pool: | ||
${{ if eq(parameters.os, 'windows') }}: | ||
vmImage: "vs2017-win2016" | ||
${{ if eq(parameters.os, 'macOs') }}: | ||
vmImage: "macOS 10.13" | ||
${{ if eq(parameters.os, 'linux') }}: | ||
vmImage: "Ubuntu 16.04" | ||
|
||
variables: | ||
${{ if in(parameters.python, 'pypy', 'pypy3') }}: | ||
python: ${{ parameters.python }} | ||
${{ if notIn(parameters.python, 'pypy', 'pypy3') }}: | ||
python: "python" | ||
|
||
steps: | ||
# ensure the required Python versions are available | ||
- ${{ if notIn(parameters.python, 'pypy', 'pypy3') }}: | ||
- task: UsePythonVersion@0 | ||
displayName: setup python | ||
inputs: | ||
versionSpec: ${{ parameters.python }} | ||
|
||
- script: "$(python) -c \"import sys; print(sys.version); print(sys.executable)\"" | ||
displayName: show python information | ||
|
||
- script: "python -m pip install -U pip setuptools --user -v" | ||
displayName: upgrade pip and setuptools | ||
|
||
- script: "python -m pip install -U tox --pre --user -v" | ||
displayName: install tox | ||
|
||
- script: ${{ format('python -m tox -e {0} --notest', parameters.tox) }} | ||
displayName: install test dependencies | ||
|
||
- ${{ if startsWith(parameters.tox, 'py') }}: | ||
- script: python -m tox -e coverage --notest | ||
displayName: install coverage dependencies | ||
|
||
- script: ${{ format('python -m tox -e {0}', parameters.tox) }} | ||
displayName: run tests | ||
|
||
- ${{ if and( startsWith(parameters.tox, 'py'), eq(variables['system.pullrequest.isfork'], false) ) }}: | ||
- task: PublishTestResults@2 | ||
displayName: publish test results via junit | ||
condition: succeededOrFailed() | ||
inputs: | ||
testResultsFormat: "JUnit" | ||
testResultsFiles: ${{ format('$(System.DefaultWorkingDirectory)/.tox/.test.{0}.xml', parameters.tox) }} | ||
testRunTitle: ${{ format('{0}_{1}', parameters.os, parameters.tox) }} | ||
|
||
- ${{ if startsWith(parameters.tox, 'py') }}: | ||
- script: "python -m tox -e coverage" | ||
displayName: create coverag report | ||
condition: succeededOrFailed() | ||
|
||
- ${{ if and( startsWith(parameters.tox, 'py'), eq(variables['system.pullrequest.isfork'], false) ) }}: | ||
- task: CopyFiles@2 | ||
displayName: move coverage files into staging area | ||
condition: succeededOrFailed() | ||
inputs: | ||
sourceFolder: $(System.DefaultWorkingDirectory)/.tox | ||
contents: | | ||
.coverage | ||
coverage.xml | ||
targetFolder: $(Build.StagingDirectory) | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: publish coverage file | ||
condition: succeededOrFailed() | ||
inputs: | ||
pathtoPublish: $(Build.ArtifactStagingDirectory) | ||
ArtifactName: ${{ format('coverage-{0}-{1}', parameters.os, parameters.tox) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters