From c05c2289ce3bc67e671d9784dbc6cae3668b5cb7 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 11:20:30 +0800 Subject: [PATCH 1/7] [ci] Improve azure pipeline framework --- .azure-pipelines/build-template.yml | 68 ++++++++++++++++++++++------- azure-pipelines.yml | 29 +++++++++++- 2 files changed, 79 insertions(+), 18 deletions(-) diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 6cd6a7a699..cd87a3b736 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -23,6 +23,12 @@ parameters: - name: sonic_slave type: string +- name: buildimage_artifact_name + type: string + +- name: buildimage_pipeline + type: number + - name: sairedis_artifact_name type: string @@ -36,6 +42,10 @@ parameters: type: boolean default: false +- name: archive_gcov + type: boolean + default: false + jobs: - job: displayName: ${{ parameters.arch }} @@ -51,26 +61,27 @@ jobs: image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest steps: + - checkout: self + clean: true + submodules: true + - script: | + if [[ "$(Build.Reason)" == "PullRequest" ]];then + echo "##vso[task.setvariable variable=sourceBranch]$(System.PullRequest.TargetBranch)" + else + echo "##vso[task.setvariable variable=sourceBranch]$(Build.SourceBranchName)" + fi + displayName: "Get correct artifact downloading branch" - script: | sudo apt-get install -y libhiredis0.14 libhiredis-dev sudo apt-get install -y libzmq5 libzmq3-dev sudo apt-get install -qq -y \ libhiredis-dev \ - libnl-3-dev \ - libnl-genl-3-dev \ - libnl-route-3-dev \ - libnl-nf-3-dev \ swig3.0 sudo apt-get install -y libdbus-1-3 sudo apt-get install -y libteam-dev \ libteam5 \ libteamdctl0 displayName: "Install dependencies" - - script: | - ls -al $(Pipeline.Workspace) - rm -rf $(Pipeline.Workspace)/*.deb - ls -al $(Pipeline.Workspace) - displayName: "Clean workspace" - task: DownloadPipelineArtifact@2 inputs: source: specific @@ -78,7 +89,8 @@ jobs: pipeline: 9 artifact: ${{ parameters.swss_common_artifact_name }} runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' + runBranch: 'refs/heads/$(sourceBranch)' + path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}' displayName: "Download sonic swss common deb packages" - task: DownloadPipelineArtifact@2 inputs: @@ -87,11 +99,35 @@ jobs: pipeline: 12 artifact: ${{ parameters.sairedis_artifact_name }} runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' + runBranch: 'refs/heads/$(sourceBranch)' + path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}' displayName: "Download sonic sairedis deb packages" + - task: DownloadPipelineArtifact@2 + inputs: + source: specific + project: build + allowFailedBuilds: true + pipeline: ${{ parameters.buildimage_pipeline }} + runVersion: 'latestFromBranch' + runBranch: 'refs/heads/$(sourceBranch)' + path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}' + patterns: | + **/target/debs/**/libnl-3-200_*.deb + **/target/debs/**/libnl-3-dev_*.deb + **/target/debs/**/libnl-genl-3-200_*.deb + **/target/debs/**/libnl-genl-3-dev_*.deb + **/target/debs/**/libnl-route-3-200_*.deb + **/target/debs/**/libnl-route-3-dev_*.deb + **/target/debs/**/libnl-nf-3-200_*.deb + **/target/debs/**/libnl-nf-3-dev_*.deb + displayName: "Download sonic buildimage deb packages" - script: | + set -ex + sudo dpkg -i $(find $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }} -name "*.deb") + cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }} sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb + cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }} sudo dpkg -i libsaivs_*.deb sudo dpkg -i libsaivs-dev_*.deb sudo dpkg -i libsairedis_*.deb @@ -99,14 +135,14 @@ jobs: sudo dpkg -i libsaimetadata_*.deb sudo dpkg -i libsaimetadata-dev_*.deb sudo dpkg -i syncd-vs_*.deb - workingDirectory: $(Pipeline.Workspace) - displayName: "Install sonic swss common and sairedis" - - checkout: self - submodules: true + displayName: "Install libnl3, sonic swss common and sairedis" - script: | - set -x + set -ex tar czf pytest.tgz tests cp -r pytest.tgz $(Build.ArtifactStagingDirectory)/ + if [ '${{ parameters.archive_gcov }}' == True ]; then + export ENABLE_GCOV=y + fi ./autogen.sh dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb . displayName: "Compile sonic swss" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a8cfe15cb2..8a2ef98170 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,14 +16,16 @@ stages: parameters: arch: amd64 sonic_slave: sonic-slave-buster + buildimage_artifact_name: sonic-buildimage.vs + buildimage_pipeline: 142 swss_common_artifact_name: sonic-swss-common sairedis_artifact_name: sonic-sairedis artifact_name: sonic-swss archive_pytests: true + archive_gcov: true - stage: BuildArm - dependsOn: Build - condition: succeeded('Build') + dependsOn: [] jobs: - template: .azure-pipelines/build-template.yml parameters: @@ -31,9 +33,12 @@ stages: timeout: 240 pool: sonicbld-armhf sonic_slave: sonic-slave-buster-armhf + buildimage_artifact_name: sonic-buildimage.marvell-armhf + buildimage_pipeline: 141 swss_common_artifact_name: sonic-swss-common.armhf sairedis_artifact_name: sonic-sairedis.armhf artifact_name: sonic-swss.armhf + archive_gcov: false - template: .azure-pipelines/build-template.yml parameters: @@ -42,8 +47,11 @@ stages: pool: sonicbld-arm64 sonic_slave: sonic-slave-buster-arm64 swss_common_artifact_name: sonic-swss-common.arm64 + buildimage_artifact_name: sonic-buildimage.centec-arm64 + buildimage_pipeline: 140 sairedis_artifact_name: sonic-sairedis.arm64 artifact_name: sonic-swss.arm64 + archive_gcov: false - stage: BuildDocker dependsOn: Build @@ -63,3 +71,20 @@ stages: - template: .azure-pipelines/test-docker-sonic-vs-template.yml parameters: log_artifact_name: log + gcov_artifact_name: sonic-gcov + sonic_slave: sonic-slave-buster + archive_gcov: true + +- stage: Gcov + dependsOn: Test + condition: always() + jobs: + - template: .azure-pipelines/gcov.yml + parameters: + arch: amd64 + sonic_slave: sonic-slave-buster + swss_common_artifact_name: sonic-swss-common + sairedis_artifact_name: sonic-sairedis + swss_artifact_name: sonic-swss + artifact_name: sonic-gcov + archive_gcov: true From 4727f53bbcf7947cef9ecb5d8d49b099083d4f1a Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 11:24:14 +0800 Subject: [PATCH 2/7] fix --- .azure-pipelines/docker-sonic-vs/Dockerfile | 13 ++ .azure-pipelines/gcov.yml | 129 ++++++++++++++++++ .../test-docker-sonic-vs-template.yml | 31 ++++- 3 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 .azure-pipelines/gcov.yml diff --git a/.azure-pipelines/docker-sonic-vs/Dockerfile b/.azure-pipelines/docker-sonic-vs/Dockerfile index d425a6ffea..f288c8fdaa 100644 --- a/.azure-pipelines/docker-sonic-vs/Dockerfile +++ b/.azure-pipelines/docker-sonic-vs/Dockerfile @@ -4,6 +4,15 @@ ARG docker_container_name ADD ["debs", "/debs"] +RUN dpkg --purge python-swsscommon +RUN dpkg --purge python3-swsscommon +RUN dpkg --purge swss +RUN dpkg --purge libsairedis +RUN dpkg --purge libswsscommon +RUN dpkg --purge libsaimetadata +RUN dpkg --purge libsaivs +RUN dpkg --purge syncd-vs + RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb RUN dpkg -i /debs/python-swsscommon_1.0.0_amd64.deb RUN dpkg -i /debs/python3-swsscommon_1.0.0_amd64.deb @@ -15,3 +24,7 @@ RUN dpkg -i /debs/syncd-vs_1.0.0_amd64.deb RUN dpkg --purge swss RUN dpkg -i /debs/swss_1.0.0_amd64.deb + +RUN apt-get update + +RUN apt-get -y install lcov diff --git a/.azure-pipelines/gcov.yml b/.azure-pipelines/gcov.yml new file mode 100644 index 0000000000..0940f82cce --- /dev/null +++ b/.azure-pipelines/gcov.yml @@ -0,0 +1,129 @@ +parameters: +- name: arch + type: string + values: + - amd64 + default: amd64 + +- name: pool + type: string + values: + - sonicbld + - default + default: default + +- name: timeout + type: number + default: 180 + +- name: sonic_slave + type: string + +- name: sairedis_artifact_name + type: string + +- name: swss_common_artifact_name + type: string + +- name: swss_artifact_name + type: string + +- name: artifact_name + type: string + +- name: archive_gcov + type: boolean + default: false + +jobs: +- job: + displayName: ${{ parameters.arch }} + timeoutInMinutes: ${{ parameters.timeout }} + + pool: + ${{ if ne(parameters.pool, 'default') }}: + name: ${{ parameters.pool }} + ${{ if eq(parameters.pool, 'default') }}: + vmImage: 'ubuntu-20.04' + + variables: + DIFF_COVER_CHECK_THRESHOLD: 0 + DIFF_COVER_ENABLE: 'true' + DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/gcov/ + + container: + image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest + + + steps: + - script: | + set -ex + # Install .NET CORE + curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - + sudo apt-add-repository https://packages.microsoft.com/debian/10/prod + sudo apt-get update + sudo apt-get install -y dotnet-sdk-5.0 + displayName: "Install .NET CORE" + - script: | + sudo apt-get install -y lcov + displayName: "Install dependencies" + condition: eq('${{ parameters.archive_gcov }}', true) + - task: DownloadPipelineArtifact@2 + inputs: + artifact: ${{ parameters.artifact_name }} + displayName: "Download gcov artifact" + condition: eq('${{ parameters.archive_gcov }}', true) + - script: | + set -x + ls -lh + sudo tar -zxvf sonic-gcov.tar.gz + sudo cp -rf sonic-gcov $(Build.ArtifactStagingDirectory) + sudo rm sonic-gcov.tar.gz + ls -lh + workingDirectory: $(Pipeline.Workspace) + displayName: "store sonic-gcov" + condition: eq('${{ parameters.archive_gcov }}', true) + - checkout: self + submodules: true + condition: eq('${{ parameters.archive_gcov }}', true) + - script: | + set -x + wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + sudo dpkg -i packages-microsoft-prod.deb + sudo apt-get update + sudo apt-get install -y dotnet-sdk-5.0 + pushd ./s/ + sudo tar -zcvf swss.tar.gz ./* + ls -lh ./* + cp ./gcovpreload/lcov_cobertura.py $(Build.ArtifactStagingDirectory)/ + cp ./tests/gcov_support.sh $(Build.ArtifactStagingDirectory)/sonic-gcov + sudo cp -rf swss.tar.gz $(Build.ArtifactStagingDirectory)/sonic-gcov + popd + sudo cp -rf $(Build.ArtifactStagingDirectory)/sonic-gcov ./ + pushd sonic-gcov + ls -lh ./* + sudo chmod +x ./gcov_support.sh + sudo ./gcov_support.sh generate + sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory) + sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory) + mkdir -p $(System.DefaultWorkingDirectory)/gcov + sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/* $(System.DefaultWorkingDirectory)/gcov/ + ls -lh $(Build.ArtifactStagingDirectory) + popd + workingDirectory: $(Pipeline.Workspace) + displayName: "generate gcov reports" + condition: eq('${{ parameters.archive_gcov }}', true) + + - publish: $(Build.ArtifactStagingDirectory)/gcov_output + artifact: gcov_info + displayName: "Archive gcov info" + condition: eq('${{ parameters.archive_gcov }}', true) + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/coverage.xml' + reportDirectory: '$(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/' + displayName: 'Publish c c++ test coverage' + condition: eq('${{ parameters.archive_gcov }}', true) + diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml index d5db0e1c8f..237778af4a 100644 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ b/.azure-pipelines/test-docker-sonic-vs-template.yml @@ -1,11 +1,21 @@ parameters: - name: timeout type: number - default: 180 + default: 240 - name: log_artifact_name type: string +- name: gcov_artifact_name + type: string + +- name: sonic_slave + type: string + +- name: archive_gcov + type: boolean + default: false + jobs: - job: displayName: vstest @@ -53,7 +63,12 @@ jobs: sudo /sbin/ip link add Vrf1 type vrf table 1001 || { echo 'vrf command failed' ; exit 1; } sudo /sbin/ip link del Vrf1 type vrf table 1001 pushd tests - sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) + + if [ '${{ parameters.archive_gcov }}' == True ]; then + sudo py.test -v --force-flaky --junitxml=tr.xml --keeptb --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) + else + sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) + fi displayName: "Run vs tests" - task: PublishTestResults@2 @@ -64,9 +79,21 @@ jobs: - script: | cp -r tests/log $(Build.ArtifactStagingDirectory)/ + + if [ '${{ parameters.archive_gcov }}' == True ]; then + sudo apt-get install -y lcov + ./tests/gcov_support.sh set_environment $(Build.ArtifactStagingDirectory) + docker stop $(docker ps -q -a) + docker rm $(docker ps -q -a) + fi displayName: "Collect logs" condition: always() + - publish: $(Build.ArtifactStagingDirectory)/gcov_tmp + artifact: ${{ parameters.gcov_artifact_name }} + displayName: "Publish gcov output" + condition: eq('${{ parameters.archive_gcov }}', true) + - publish: $(Build.ArtifactStagingDirectory)/ artifact: ${{ parameters.log_artifact_name }}@$(System.JobAttempt) displayName: "Publish logs" From da85bc7691bdaedf3f674f583107206161622efb Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 13:31:13 +0800 Subject: [PATCH 3/7] fix --- .azure-pipelines/build-template.yml | 36 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index cd87a3b736..f464391eec 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -87,20 +87,31 @@ jobs: source: specific project: build pipeline: 9 - artifact: ${{ parameters.swss_common_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}' + allowFailedBuilds: true + path: '$(Build.SourcesDirectory)/sonic-swss-common.artifact' + patterns: | + **/libswsscommon_1.0.0_${{ parameters.arch }}.deb + **/libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb displayName: "Download sonic swss common deb packages" - task: DownloadPipelineArtifact@2 inputs: source: specific project: build pipeline: 12 - artifact: ${{ parameters.sairedis_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}' + allowFailedBuilds: true + path: '$(Build.SourcesDirectory)/sonic-sairedis.artifact' + patterns: | + **/libsaivs_*.deb + **/libsaivs-dev_*.deb + **/libsairedis_*.deb + **/libsairedis-dev_*.deb + **/libsaimetadata_*.deb + **/libsaimetadata-dev_*.deb + **/syncd-vs_*.deb displayName: "Download sonic sairedis deb packages" - task: DownloadPipelineArtifact@2 inputs: @@ -110,7 +121,7 @@ jobs: pipeline: ${{ parameters.buildimage_pipeline }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}' + path: '$(Build.SourcesDirectory)/sonic-buildimage.vs.artifact' patterns: | **/target/debs/**/libnl-3-200_*.deb **/target/debs/**/libnl-3-dev_*.deb @@ -123,18 +134,9 @@ jobs: displayName: "Download sonic buildimage deb packages" - script: | set -ex - sudo dpkg -i $(find $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }} -name "*.deb") - cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }} - sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb - sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb - cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }} - sudo dpkg -i libsaivs_*.deb - sudo dpkg -i libsaivs-dev_*.deb - sudo dpkg -i libsairedis_*.deb - sudo dpkg -i libsairedis-dev_*.deb - sudo dpkg -i libsaimetadata_*.deb - sudo dpkg -i libsaimetadata-dev_*.deb - sudo dpkg -i syncd-vs_*.deb + sudo dpkg -i $(find sonic-buildimage.vs.artifact -name "*.deb") + sudo dpkg -i $(find sonic-swss-common.artifact -name "*.deb") + sudo dpkg -i $(find sonic-sairedis.artifact -name "*.deb") displayName: "Install libnl3, sonic swss common and sairedis" - script: | set -ex From 8827449646369ccfafca659131b4b878cccf41cc Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 14:55:58 +0800 Subject: [PATCH 4/7] fix --- .azure-pipelines/build-template.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index f464391eec..26eb5363d8 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -65,11 +65,12 @@ jobs: clean: true submodules: true - script: | + sourceBranch=$(Build.SourceBranchName) if [[ "$(Build.Reason)" == "PullRequest" ]];then - echo "##vso[task.setvariable variable=sourceBranch]$(System.PullRequest.TargetBranch)" - else - echo "##vso[task.setvariable variable=sourceBranch]$(Build.SourceBranchName)" + sourceBranch=$(System.PullRequest.TargetBranch) fi + echo "Download artifact branch: $sourceBranch" + echo "##vso[task.setvariable variable=sourceBranch]$sourceBranch" displayName: "Get correct artifact downloading branch" - script: | sudo apt-get install -y libhiredis0.14 libhiredis-dev @@ -87,10 +88,11 @@ jobs: source: specific project: build pipeline: 9 + artifact: ${{ parameters.swss_common_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - allowFailedBuilds: true - path: '$(Build.SourcesDirectory)/sonic-swss-common.artifact' + path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}' + allowPartiallySucceededBuilds: true patterns: | **/libswsscommon_1.0.0_${{ parameters.arch }}.deb **/libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb @@ -100,10 +102,11 @@ jobs: source: specific project: build pipeline: 12 + artifact: ${{ parameters.sairedis_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - allowFailedBuilds: true - path: '$(Build.SourcesDirectory)/sonic-sairedis.artifact' + path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}' + allowPartiallySucceededBuilds: true patterns: | **/libsaivs_*.deb **/libsaivs-dev_*.deb @@ -117,11 +120,11 @@ jobs: inputs: source: specific project: build - allowFailedBuilds: true pipeline: ${{ parameters.buildimage_pipeline }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' - path: '$(Build.SourcesDirectory)/sonic-buildimage.vs.artifact' + path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}' + allowPartiallySucceededBuilds: true patterns: | **/target/debs/**/libnl-3-200_*.deb **/target/debs/**/libnl-3-dev_*.deb @@ -134,9 +137,9 @@ jobs: displayName: "Download sonic buildimage deb packages" - script: | set -ex - sudo dpkg -i $(find sonic-buildimage.vs.artifact -name "*.deb") - sudo dpkg -i $(find sonic-swss-common.artifact -name "*.deb") - sudo dpkg -i $(find sonic-sairedis.artifact -name "*.deb") + sudo dpkg -i $(find ${{ parameters.buildimage_artifact_name }} -name "*.deb") + sudo dpkg -i $(find ${{ parameters.swss_common_artifact_name }} -name "*.deb") + sudo dpkg -i $(find ${{ parameters.sairedis_artifact_name }} -name "*.deb") displayName: "Install libnl3, sonic swss common and sairedis" - script: | set -ex From 0875357518343b26d17505cf2abd57856c0c3036 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 14:58:08 +0800 Subject: [PATCH 5/7] fix --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8a2ef98170..06cd17686e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,7 +25,8 @@ stages: archive_gcov: true - stage: BuildArm - dependsOn: [] + dependsOn: Build + condition: succeeded('Build') jobs: - template: .azure-pipelines/build-template.yml parameters: From b7fdf308f9b806c7d4ee7aa04e3a238d6d6f28b2 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 15:10:44 +0800 Subject: [PATCH 6/7] fix --- .azure-pipelines/build-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 26eb5363d8..40f85237d6 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -92,7 +92,7 @@ jobs: runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}' - allowPartiallySucceededBuilds: true + allowFailedBuilds: true patterns: | **/libswsscommon_1.0.0_${{ parameters.arch }}.deb **/libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb @@ -106,7 +106,7 @@ jobs: runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}' - allowPartiallySucceededBuilds: true + allowFailedBuilds: true patterns: | **/libsaivs_*.deb **/libsaivs-dev_*.deb @@ -124,7 +124,7 @@ jobs: runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(sourceBranch)' path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}' - allowPartiallySucceededBuilds: true + allowFailedBuilds: true patterns: | **/target/debs/**/libnl-3-200_*.deb **/target/debs/**/libnl-3-dev_*.deb From 4ef7707a4be29455c80a6e1f291c9d0808bcc23b Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 27 Jan 2022 15:25:46 +0800 Subject: [PATCH 7/7] fix --- azure-pipelines.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 06cd17686e..6db3c6bda5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,21 @@ trigger: branches: include: - - "*" + - master + - 20???? +pr: + branches: + include: + - master + - 20???? +schedules: +- cron: "0 0 * * 0" + displayName: Weekly Sunday build + branches: + include: + - master + - 20???? + always: true stages: - stage: Build @@ -25,8 +39,7 @@ stages: archive_gcov: true - stage: BuildArm - dependsOn: Build - condition: succeeded('Build') + dependsOn: [] jobs: - template: .azure-pipelines/build-template.yml parameters: