From 01b631dc126b677bdad4698eba88481b83ad611b Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Mon, 10 May 2021 15:45:20 -0500 Subject: 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 --- .ci/templates/job-uhd-build-src.yml | 43 +++++++++++++++++++--------- .ci/templates/steps-build-uhd-ubuntu-deb.yml | 17 +++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 .ci/templates/steps-build-uhd-ubuntu-deb.yml (limited to '.ci/templates') 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 -- cgit v1.2.3