aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/job-uhd-build-src.yml
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2021-03-16 12:39:29 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-19 15:40:09 -0500
commit3b29a89b9f9a8167a595eed2988b89e2a7f2112a (patch)
tree8606482f63f69d2aee7a926b5ffc540ffc13ec28 /.ci/templates/job-uhd-build-src.yml
parent9aafc0ace2272746d708dcac6e5daaa50b7da4c7 (diff)
downloaduhd-3b29a89b9f9a8167a595eed2988b89e2a7f2112a.tar.gz
uhd-3b29a89b9f9a8167a595eed2988b89e2a7f2112a.tar.bz2
uhd-3b29a89b9f9a8167a595eed2988b89e2a7f2112a.zip
ci: Build uhd with Pipelines
This commit adds the infrastructure to build uhd on both Linux and Windows using Pipelines. Using the docker images generated by the build docker pipeline, this runs an AzDO container job to build uhd artifacts. It then stores the artifacts to be used in later pipelines or stages. This change supports make and ninja on Linux and msbuild with VS2017/VS2019 x86/x64 on Windows. Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to '.ci/templates/job-uhd-build-src.yml')
-rw-r--r--.ci/templates/job-uhd-build-src.yml99
1 files changed, 99 insertions, 0 deletions
diff --git a/.ci/templates/job-uhd-build-src.yml b/.ci/templates/job-uhd-build-src.yml
new file mode 100644
index 000000000..6e945d789
--- /dev/null
+++ b/.ci/templates/job-uhd-build-src.yml
@@ -0,0 +1,99 @@
+parameters:
+- name: 'toolset'
+ type: string
+ values:
+ - make
+ - ninja
+ - msbuild
+
+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'] ]
+ 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 ne(parameters.toolset, 'msbuild') }}:
+ matrix: $[ variables.dockerImageMatrixLin ]
+ container:
+ image: '$(dockerImagePrefix)$(DockerImageName):$(dockerBuildNumber)'
+ endpoint: 'Docker / Artifactory - rnd-builds-local'
+ 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, '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)
+
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Build.BinariesDirectory)
+ targetFolder: $(Build.ArtifactStagingDirectory)
+ displayName: Copy build files to artifact folder
+
+ - 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
+
+ - 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