forked from pypa/virtualenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
132 lines (126 loc) · 4.44 KB
/
azure-pipelines.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
resources:
repositories:
- repository: tox
type: github
endpoint: github-gb
name: tox-dev/azure-pipelines-template
ref: master
trigger:
batch: true
branches:
include:
- master
- legacy
- refs/tags/*
pr:
branches:
include:
- '*'
schedules:
- cron: "12 0 * * *"
displayName: Daily build
branches:
include: [ master, rewrite ]
always: true
variables:
PYTEST_ADDOPTS: "-vv --durations=10"
CI_RUN: 'yes'
UPGRADE_ADVISORY: 'yes'
jobs:
- template: run-tox-env.yml@tox
parameters:
jobs:
py38:
image: [linux, vs2017-win2016, macOs]
py37:
image: [linux, vs2017-win2016, macOs]
py36:
image: [linux, vs2017-win2016, macOs]
py35:
image: [linux, vs2017-win2016, macOs]
py27:
image: [linux, windows, macOs]
pypy:
image: [linux, windows, macOs]
pypy3:
image: [linux, windows, macOs]
homebrew_py3:
image: [macOs]
py: brew@python3
toxenv: py37
homebrew_py2:
image: [macOs]
py: brew@python2
toxenv: py27
fix_lint:
image: [linux, windows]
docs:
image: [linux, windows]
readme:
image: [linux, windows]
upgrade:
image: [linux, windows]
dev: null
zipapp:
image: [linux, windows]
after:
- task: CopyFiles@2
displayName: move generated zipapp
condition: eq(variables['image_name'], 'linux')
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)
contents: |
virtualenv.pyz
targetFolder: $(Build.StagingDirectory)
- task: PublishBuildArtifacts@1
displayName: publish zipapp
condition: eq(variables['image_name'], 'linux')
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
ArtifactName: virtualenv.pyz
before:
- script: '$(toxPython.pythonLocation)/python -m pip install "virtualenv < 20"'
displayName: pypy3 tox needs fix to accomodate separate bin and Script
condition: and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'pypy3'))
- script: '$(toxPython.pythonLocation)/python -m pip install .'
displayName: tox uses this virtualenv (eat our own dogfood)
condition: not(and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'pypy3')))
- script: 'sudo apt-get update -y && sudo apt-get install fish csh'
condition: and(succeeded(), eq(variables['image_name'], 'linux'), in(variables['TOXENV'], 'py38', 'py37', 'py36', 'py35', 'py27', 'pypy', 'pypy3'))
displayName: install fish and csh via apt-get
- script: 'brew update -vvv && brew install fish tcsh'
condition: and(succeeded(), eq(variables['image_name'], 'macOs'), in(variables['TOXENV'], 'py38', 'py37', 'py36', 'py35', 'py27', 'pypy', 'pypy3'))
displayName: install fish and csh via brew
- task: UsePythonVersion@0
condition: and(succeeded(), in(variables['TOXENV'], 'py38', 'py37', 'py36', 'py35'))
displayName: provision cpython 2
inputs:
versionSpec: '2.7'
- task: UsePythonVersion@0
condition: and(succeeded(), in(variables['TOXENV'], 'py27'))
displayName: provision cpython 3
inputs:
versionSpec: '3.8'
- task: UsePythonVersion@0
condition: and(succeeded(), in(variables['TOXENV'], 'pypy'))
displayName: provision pypy 3
inputs:
versionSpec: 'pypy3'
- task: UsePythonVersion@0
condition: and(succeeded(), in(variables['TOXENV'], 'pypy3'))
displayName: provision pypy 2
inputs:
versionSpec: 'pypy2'
- script: choco install vcpython27 --yes -f
condition: and(succeeded(), eq(variables['image_name'], 'windows'), in(variables['TOXENV'], 'py27', 'pypy'))
displayName: Install Visual C++ for Python 2.7
coverage:
with_toxenv: 'coverage' # generate .tox/.coverage, .tox/coverage.xml after test run
for_envs: [py38, py37, py36, py35, py27, pypy, pypy3]
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
- template: publish-pypi.yml@tox
parameters:
external_feed: 'gb'
pypi_remote: 'pypi-gb'
dependsOn: [fix_lint, docs, report_coverage, dev, readme, zipapp, upgrade]