blob: 9315a3544672186b17e7e20c9048b289a7f01e22 [file] [log] [blame]
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=20"
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]