summaryrefslogtreecommitdiff
path: root/.azure-pipelines/windows-appx-test.yml
blob: 9840c0a1221f69cef7240e2b55975770c7948976 (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
jobs:
- job: Prebuild
  displayName: Pre-build checks

  pool:
    vmImage: ubuntu-16.04

  steps:
  - template: ./prebuild-checks.yml


- job: Windows_Appx_Tests
  displayName: Windows Appx Tests
  dependsOn: Prebuild
  condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

  pool:
    vmImage: vs2017-win2016

  strategy:
    matrix:
      win64:
        arch: amd64
        buildOpt: '-p x64'
        testRunTitle: '$(Build.SourceBranchName)-win64-appx'
        testRunPlatform: win64
    maxParallel: 2

  steps:
  - checkout: self
    clean: true
    fetchDepth: 5

  - powershell: |
      # Relocate build outputs outside of source directory to make cleaning faster
      Write-Host '##vso[task.setvariable variable=Py_IntDir]$(Build.BinariesDirectory)\obj'
      # UNDONE: Do not build to a different directory because of broken tests
      Write-Host '##vso[task.setvariable variable=Py_OutDir]$(Build.SourcesDirectory)\PCbuild'
      Write-Host '##vso[task.setvariable variable=EXTERNAL_DIR]$(Build.BinariesDirectory)\externals'
    displayName: Update build locations

  - script: PCbuild\build.bat -e $(buildOpt)
    displayName: 'Build CPython'

  - script: python.bat PC\layout -vv -s "$(Build.SourcesDirectory)" -b "$(Py_OutDir)\$(arch)" -t "$(Py_IntDir)\layout-tmp-$(arch)" --copy "$(Py_IntDir)\layout-$(arch)" --precompile --preset-appx --include-tests
    displayName: 'Create APPX layout'

  - script: .\python.exe -m test.pythoninfo
    workingDirectory: $(Py_IntDir)\layout-$(arch)
    displayName: 'Display build info'

  - script: .\python.exe -m test -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir "$(Py_IntDir)\tmp-$(arch)"
    workingDirectory: $(Py_IntDir)\layout-$(arch)
    displayName: 'Tests'
    env:
      PREFIX: $(Py_IntDir)\layout-$(arch)

  - task: PublishTestResults@2
    displayName: 'Publish Test Results'
    inputs:
      testResultsFiles: '$(Build.BinariesDirectory)\test-results.xml'
      mergeTestResults: true
      testRunTitle: $(testRunTitle)
      platform: $(testRunPlatform)
    condition: succeededOrFailed()