aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/job-uhd-build-src.yml
blob: 25f8b489736e4f4fe9071095ab635c644146817a (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
parameters:
- name: 'toolset'
  type: string
  values:
  - make
  - make_custom_boost_version
  - make_trace
  - ninja
  - msbuild
  - ubuntu_deb
- name: 'custom_boost_version_url'
  type: string
  default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'


jobs:
- job: build_ctest_and_upload_uhd_${{ parameters.toolset }}
  displayName: ${{ parameters.toolset }}, ctest, and upload UHD
  dependsOn: get_latest_uhd_docker
  variables:
    # Docker vars from job-get-latest-uhd-docker.yml
    dockerBuildNumber: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerBuildNumber'] ]
    dockerImagePrefix: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImagePrefix'] ]
    dockerImageMatrixLin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixLin'] ]
    dockerImageMatrixWin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixWin'] ]
    dockerImageMatrixUbuntuDeb: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixUbuntuDeb'] ]
  pool:
    ${{ if eq(parameters.toolset, 'msbuild') }}:
      name: de-dre-lab
    ${{ if ne(parameters.toolset, 'msbuild') }}:
      name: Drivers-NIBuildFarm-RFMIBUILD
    demands:
      - docker
      - ${{ if eq(parameters.toolset, 'msbuild') }}:
        - Agent.OS -equals Windows_NT
      - ${{ if ne(parameters.toolset, 'msbuild') }}:
        - Agent.OS -equals Linux
  workspace:
    clean: outputs
  strategy:
    ${{ if eq(parameters.toolset, 'msbuild') }}:
      matrix: $[ variables.dockerImageMatrixWin ]
    ${{ if or(eq(parameters.toolset, 'make'), eq(parameters.toolset, 'make_trace'), eq(parameters.toolset, 'ninja'), eq(parameters.toolset, 'make_custom_boost_version')) }}:
      matrix: $[ variables.dockerImageMatrixLin ]
    ${{ if eq(parameters.toolset, 'ubuntu_deb') }}:
      matrix: $[ variables.dockerImageMatrixUbuntuDeb ]
  container:
    image: '$(dockerImagePrefix)$(DockerImageName):$(dockerBuildNumber)'
    endpoint: 'Docker / Artifactory - rnd-builds-local'
    ${{ if eq(parameters.toolset, 'ubuntu_deb') }}:
      #pbuilder requires access to /proc
      options: --privileged
  steps:
  - checkout: self
    clean: true

  - download: uhd_build_docker_container

  - ${{ if eq(parameters.toolset, 'make') }}:
    - template: steps-build-uhd-make.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build

  - ${{ if eq(parameters.toolset, 'make_trace') }}:
    - template: steps-build-uhd-make.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
        uhdEnableTraceLog: true

  - ${{ if eq(parameters.toolset, 'ninja') }}:
    - template: steps-build-uhd-ninja.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build

  - ${{ if eq(parameters.toolset, 'msbuild') }}:
    - template: steps-build-uhd-msbuild.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)\uhddev\build
        cmakeCompiler: $(cmakeCompiler)
        cmakeArch: $(cmakeArch)
        vsArch: $(vsArch)
        vsYear: $(vsYear)

  - ${{ if eq(parameters.toolset, 'ubuntu_deb') }}:
    - template: steps-build-uhd-ubuntu-deb.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev
        ubuntuReleaseName: $(ubuntuReleaseName)

  - ${{ if eq(parameters.toolset, 'make_custom_boost_version') }}:
    - template: steps-build-uhd-make.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
        uhdCustomBoostPackage: true
        uhdCustomBoostPackageURL: ${{ parameters.custom_boost_version_url }}

  - task: ArchiveFiles@2
    inputs:
      rootFolderOrFile: $(Build.BinariesDirectory)
      includeRootFolder: false
      archiveType: tar
      tarCompression: gz
      archiveFile: $(Build.ArtifactStagingDirectory)/$(dockerOSName)-${{ parameters.toolset }}.tar.gz
      replaceExistingArchive: true
    displayName: Compress build files

  - task: CopyFiles@2
    inputs:
      sourceFolder: $(Pipeline.Workspace)/uhd_build_docker_container/$(UHDPipelineDockerImageArtifactName)
      targetFolder: $(Build.ArtifactStagingDirectory)
    displayName:  Copy builder container version to artifact folder

  - task: PublishPipelineArtifact@1
    inputs:
      targetPath: '$(Build.ArtifactStagingDirectory)'
      artifactName: '$(dockerOSName)-${{ parameters.toolset }}'
    displayName: Upload uhd build artifacts

  - ${{ if ne(parameters.toolset, 'ubuntu_deb') }}:
    - task: CopyFiles@2
      inputs:
        sourceFolder: $(Build.BinariesDirectory)/uhddev/
        contents: build/Testing/**
        targetFolder: $(Common.TestResultsDirectory)
      displayName: Copy ${{ parameters.toolset }} ctest results

    - task: PublishTestResults@2
      inputs:
        testResultsFormat: cTest
        testResultsFiles: $(Common.TestResultsDirectory)/build/Testing/**/Test.xml
        failTaskOnFailedTests: true
        testRunTitle: uhd ctest $(dockerOSName)-${{ parameters.toolset }}
      displayName: Publish $(dockerOSName)-${{ parameters.toolset }} ctest results