forked from altendky/virtualenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-run-tox-env.yml
108 lines (89 loc) · 4.1 KB
/
azure-run-tox-env.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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', 'jython') }}:
- task: UsePythonVersion@0
displayName: setup python
inputs:
versionSpec: ${{ parameters.python }}
# provision jython
- ${{ if eq(parameters.tox, 'jython') }}:
- script: "wget http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7.1/jython-installer-2.7.1.jar -O $(Agent.ToolsDirectory)/jython.jar"
displayName: download jython
- script: "java -jar $(Agent.ToolsDirectory)/jython.jar -sd $(Agent.ToolsDirectory)/jython -e demo src doc"
displayName: install jython
- script: echo "##vso[task.setvariable variable=PATH]$(Agent.ToolsDirectory)/jython/bin:$(PATH)"
displayName: setvarStep
- script: echo $(PATH)
displayName: show PATH
- script: "$(python) -c \"import sys; print(sys.version); print(sys.executable)\""
displayName: show python information
- script: "python -m pip install -U pip setuptools --user"
displayName: install pip
- script: "python -m pip install -U tox --user -v"
displayName: install tox
# provision additional shells
- ${{ if or( startsWith(parameters.tox, 'py'), eq(parameters.tox, 'jython')) }}:
- ${{if eq(parameters.os, 'linux') }}:
- script: "sudo apt-get update && sudo apt-get install fish csh"
displayName: install fish and csh
- ${{ if eq(parameters.os, 'macOs') }}:
- script: "brew update -vvv"
displayName: update brew
- script: "brew install fish tcsh"
displayName: install fish and csh
- ${{ if eq(parameters.tox, 'jython') }}:
- script: "python -m pip install --user $(System.DefaultWorkingDirectory)"
displayName: install dev venv for tox
- script: ${{ format('python -m tox -e {0} --notest --skip-missing-interpreters=false', parameters.tox) }}
displayName: install test dependencies
- ${{ if or( startsWith(parameters.tox, 'py'), eq(parameters.tox, 'jython') ) }}:
- script: python -m tox -e coverage --notest --skip-missing-interpreters=false
displayName: install coverage dependencies
- script: ${{ format('python -m tox --skip-missing-interpreters=false -e {0}', parameters.tox) }}
displayName: run tests
- ${{ if or( startsWith(parameters.tox, 'py'), eq(parameters.tox, 'jython') ) }}:
- 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 or( startsWith(parameters.tox, 'py'), eq(parameters.tox, 'jython') ) }}:
- script: "python -m tox --skip-missing-interpreters=false -e coverage"
displayName: create coverag report
condition: succeededOrFailed()
- ${{ if or( startsWith(parameters.tox, 'py'), eq(parameters.tox, 'jython') ) }}:
- 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) }}