summaryrefslogtreecommitdiff
path: root/azure-pipelines.yml
blob: 2c4b843590afc4d5b3782500644313c5ab8bd557 (plain)
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
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
resources:
  repositories:
  - repository: tox
    type: github
    endpoint: toxdevorg
    name: tox-dev/azure-pipelines-template
    ref: master

trigger:
  batch: true
  branches:
    include:
    - master
    - rewrite
    - refs/tags/*
pr:
  branches:
    include:
    - master
    - rewrite

variables:
  PYTEST_ADDOPTS: "-v -v -ra --showlocals"
  PYTEST_XDIST_PROC_NR: '0'
  PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache

jobs:
- template: run-tox-env.yml@tox
  parameters:
    tox_version: ''
    jobs:
      fix_lint:
        before:
        - task: CacheBeta@0
          displayName: cache pre-commit
          inputs:
            key: pre-commit | .pre-commit-config.yaml
            path: $(PRE_COMMIT_HOME)
      docs: null
      py310:
        image: [ linux ]
      py39:
        image: [ linux, windows, macOs ]
      py38:
        image: [linux, windows, macOs]
      py27:
        image: [linux, windows, macOs]
      pypy:
        image: [linux]
      py37:
        image: [linux, windows, macOs]
      py36:
        image: [linux, windows, macOs]
      py35:
        image: [linux, windows, macOs]
      pypy3:
        image: [linux]
      dev: null
      package_description: null
    coverage:
      with_toxenv: 'coverage' # generate .tox/.coverage, .tox/coverage.xml after test run
      for_envs: [py310, py39, py38, py37, py36, py35, py27, pypy3, pypy]
    before:
      - task: UsePythonVersion@0
        condition: and(succeeded(), in(variables['TOXENV'], 'pypy'))
        displayName: provision pypy 3
        inputs:
          versionSpec: 'pypy3'
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
  - template: publish-pypi.yml@tox
    parameters:
      external_feed: 'toxdev'
      pypi_remote: 'pypi-toxdev'
      dependsOn: [fix_lint, docs, package_description, dev, report_coverage]