diff options
author | Steven Koo <steven.koo@ni.com> | 2021-05-10 15:45:20 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-05-18 15:13:37 -0500 |
commit | 01b631dc126b677bdad4698eba88481b83ad611b (patch) | |
tree | b776c1f2b9e35dd381f3e36bb3fa2d63f36724f7 /.ci/templates | |
parent | d97eb69c721d9e43ad859a7b24361f95b8b20349 (diff) | |
download | uhd-01b631dc126b677bdad4698eba88481b83ad611b.tar.gz uhd-01b631dc126b677bdad4698eba88481b83ad611b.tar.bz2 uhd-01b631dc126b677bdad4698eba88481b83ad611b.zip |
ci: Add deb build support for ubuntu 1804/2004
This change adds build support for Ubuntu debs in CI. This will
generate the dsc file and then build the debs. These are then saved
as a pipeline artifact.
Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to '.ci/templates')
-rw-r--r-- | .ci/templates/job-uhd-build-src.yml | 43 | ||||
-rw-r--r-- | .ci/templates/steps-build-uhd-ubuntu-deb.yml | 17 |
2 files changed, 46 insertions, 14 deletions
diff --git a/.ci/templates/job-uhd-build-src.yml b/.ci/templates/job-uhd-build-src.yml index 366bb7509..a3c63897a 100644 --- a/.ci/templates/job-uhd-build-src.yml +++ b/.ci/templates/job-uhd-build-src.yml @@ -5,6 +5,7 @@ parameters: - make - ninja - msbuild + - ubuntu_deb jobs: - job: build_ctest_and_upload_uhd_${{ parameters.toolset }} @@ -16,6 +17,7 @@ jobs: 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 @@ -32,11 +34,16 @@ jobs: strategy: ${{ if eq(parameters.toolset, 'msbuild') }}: matrix: $[ variables.dockerImageMatrixWin ] - ${{ if ne(parameters.toolset, 'msbuild') }}: + ${{ if or(eq(parameters.toolset, 'make'), eq(parameters.toolset, 'ninja')) }}: 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 @@ -65,6 +72,13 @@ jobs: 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) + - task: ArchiveFiles@2 inputs: rootFolderOrFile: $(Build.BinariesDirectory) @@ -87,17 +101,18 @@ jobs: 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 + - ${{ 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 + - 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 diff --git a/.ci/templates/steps-build-uhd-ubuntu-deb.yml b/.ci/templates/steps-build-uhd-ubuntu-deb.yml new file mode 100644 index 000000000..6ad6680f2 --- /dev/null +++ b/.ci/templates/steps-build-uhd-ubuntu-deb.yml @@ -0,0 +1,17 @@ +parameters: +- name: uhdSrcDir + type: string +- name: uhdBuildDir + type: string +- name: ubuntuReleaseName + type: string + +steps: +- script: | + sudo pbuilder create --debootstrapopts --variant=buildd --distribution ${{ parameters.ubuntuReleaseName }} + displayName: Setup pbuilder +- script: | + mkdir -p ${{ parameters.uhdBuildDir }} + cd ${{ parameters.uhdSrcDir }} + python3 tools/debs/uhd_ubuntu_deb.py ${{ parameters.ubuntuReleaseName }} --buildpath ${{ parameters.uhdBuildDir }} + displayName: Build dsc and debs |