summaryrefslogtreecommitdiff
path: root/.azure-pipelines/docker-steps.yml
blob: ba4dfd72dd8bb8bbadf212fe17799578802c9cb6 (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
76
steps:
- checkout: self
  clean: true
  fetchDepth: 5

- ${{ if ne(parameters.targetBranch, '') }}:
  - script: |
     git fetch -q origin ${{ parameters.targetbranch }}
     if ! git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD) | grep -qvE '(\.rst$|^Doc|^Misc)'
     then
       echo "Only docs were updated, stopping build process."
       echo "##vso[task.setvariable variable=DocOnly]true"
       exit
     fi
    displayName: Detect doc-only changes

- task: docker@0
  displayName: 'Configure CPython (debug)'
  inputs:
    action: 'Run an image'
    imageName: $(imageName)
    volumes: |
      $(build.sourcesDirectory):/src
      $(build.binariesDirectory):/build
    workDir: '/src'
    containerCommand: './configure --with-pydebug'
    detached: false
  condition: and(succeeded(), ne(variables['DocOnly'], 'true'))

- task: docker@0
  displayName: 'Build CPython'
  inputs:
    action: 'Run an image'
    imageName: $(imageName)
    volumes: |
      $(build.sourcesDirectory):/src
      $(build.binariesDirectory):/build
    workDir: '/src'
    containerCommand: 'make -s -j4'
    detached: false
  condition: and(succeeded(), ne(variables['DocOnly'], 'true'))

- task: docker@0
  displayName: 'Display build info'
  inputs:
    action: 'Run an image'
    imageName: $(imageName)
    volumes: |
      $(build.sourcesDirectory):/src
      $(build.binariesDirectory):/build
    workDir: '/src'
    containerCommand: 'make pythoninfo'
    detached: false
  condition: and(succeeded(), ne(variables['DocOnly'], 'true'))

- task: docker@0
  displayName: 'Tests'
  inputs:
    action: 'Run an image'
    imageName: $(imageName)
    volumes: |
      $(build.sourcesDirectory):/src
      $(build.binariesDirectory):/build
    workDir: '/src'
    containerCommand: 'make buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=/build/test-results.xml"'
    detached: false
  condition: and(succeeded(), ne(variables['DocOnly'], 'true'))

- task: PublishTestResults@2
  displayName: 'Publish Test Results'
  inputs:
    testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
    mergeTestResults: true
    testRunTitle: $(testRunTitle)
    platform: $(testRunPlatform)
  condition: and(succeededOrFailed(), ne(variables['DocOnly'], 'true'))