summaryrefslogtreecommitdiff
path: root/.azure-pipelines.yml
blob: 48eb1503aad3cce89a7c8ff6f76d367a75ce147c (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
trigger:
  - master
  - '*.x'

variables:
  vmImage: ubuntu-latest
  python.version: 3.7
  TOXENV: py,coverage-ci
  hasTestResults: true

strategy:
  matrix:
    Python 3.7 Linux:
      vmImage: ubuntu-latest
    Python 3.7 Windows:
      vmImage: windows-latest
    Python 3.7 Mac:
      vmImage: macos-latest
    PyPy 3 Linux:
      python.version: pypy3
    Python 3.6 Linux:
      python.version: 3.6
    Python 3.5 Linux:
      python.version: 3.5
    Python 2.7 Linux:
      python.version: 2.7
    Python 2.7 Windows:
      python.version: 2.7
      vmImage: windows-latest
    Docs:
      TOXENV: docs-html
      hasTestResults: false

pool:
  vmImage: $[ variables.vmImage ]

steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: $(python.version)
    displayName: Use Python $(python.version)

  - script: pip --disable-pip-version-check install -U tox
    displayName: Install tox

  - script: tox -s false -- --junit-xml=test-results.xml
    displayName: Run tox

  - task: PublishTestResults@2
    inputs:
      testResultsFiles: test-results.xml
      testRunTitle: $(Agent.JobName)
    condition: eq(variables['hasTestResults'], 'true')
    displayName: Publish test results

  - task: PublishCodeCoverageResults@1
    inputs:
      codeCoverageTool: Cobertura
      summaryFileLocation: coverage.xml
    condition: eq(variables['hasTestResults'], 'true')
    displayName: Publish coverage results