Skip to content

Commit

Permalink
[ci]: show code coverage in azure pipeline (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushilongbuaa authored Nov 22, 2021
1 parent 4ceb01d commit c11a576
Showing 1 changed file with 42 additions and 36 deletions.
78 changes: 42 additions & 36 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ trigger:
include:
- "*"


jobs:
- job:
displayName: "amd64"
Expand All @@ -18,6 +19,14 @@ jobs:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest

steps:
- script: |
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get install -y dotnet-sdk-6.0
displayName: install .Net
- script: |
sudo apt-get install -y \
libboost1.71-dev \
Expand Down Expand Up @@ -47,6 +56,9 @@ jobs:
libnl-nf-3-200
displayName: "Install dependencies"
- checkout: self
clean: true
submodules: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand All @@ -55,32 +67,31 @@ jobs:
artifact: sonic-swss-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/sonic-swss-common'
displayName: "Download sonic swss common deb packages"
- script: |
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i libswsscommon-dev_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)
sudo dpkg -i sonic-swss-common/libswsscommon_1.0.0_amd64.deb
sudo dpkg -i sonic-swss-common/libswsscommon-dev_1.0.0_amd64.deb
displayName: "Install sonic swss common"
- checkout: self
submodules: true
- script: |
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
rm ../*.deb
dpkg-buildpackage -us -uc -b -j$(nproc)
cp ../*.deb $(Build.ArtifactStagingDirectory)
displayName: "Compile sonic linkmgrd"
- publish: $(System.DefaultWorkingDirectory)/
- publish: $(Build.ArtifactStagingDirectory)
artifact: sonic-linkmgrd_1.0.0-1.amd64
displayName: "Archive linkmgrd debian packages"

- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/linkmgrd-test-result.xml
pathToSources: $(System.DefaultWorkingDirectory)/sonic-linkmgr/
summaryFileLocation: linkmgrd-test-result.xml
pathToSources: $(Build.SourcesDirectory)
codeCoverageTool: 'Cobertura'


- job:
displayName: "arm64"
timeoutInMinutes: 180
pool: sonicbld-arm64

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-arm64:latest

Expand Down Expand Up @@ -114,6 +125,9 @@ jobs:
libnl-nf-3-200
displayName: "Install dependencies"
- checkout: self
clean: true
submodules: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand All @@ -122,32 +136,26 @@ jobs:
artifact: sonic-swss-common.arm64
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/sonic-swss-common.arm64'
displayName: "Download sonic swss common deb packages"
- script: |
sudo dpkg -i libswsscommon_1.0.0_arm64.deb
sudo dpkg -i libswsscommon-dev_1.0.0_arm64.deb
workingDirectory: $(Pipeline.Workspace)
sudo dpkg -i sonic-swss-common.arm64/libswsscommon_1.0.0_arm64.deb
sudo dpkg -i sonic-swss-common.arm64/libswsscommon-dev_1.0.0_arm64.deb
displayName: "Install sonic swss common"
- checkout: self
submodules: true
- script: |
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
rm ../*.deb
dpkg-buildpackage -us -uc -b -j$(nproc)
cp ../*.deb $(Build.ArtifactStagingDirectory)
displayName: "Compile sonic linkmgrd"
- publish: $(System.DefaultWorkingDirectory)/
- publish: $(Build.ArtifactStagingDirectory)
artifact: sonic-linkmgrd.arm64
displayName: "Archive linkmgrd debian packages"

- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/linkmgrd-test-result.xml
pathToSources: $(System.DefaultWorkingDirectory)/sonic-linkmgr/


- job:
displayName: "armhf"
timeoutInMinutes: 180
pool: sonicbld-armhf

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-armhf:latest

Expand Down Expand Up @@ -181,6 +189,9 @@ jobs:
libnl-nf-3-200
displayName: "Install dependencies"
- checkout: self
clean: true
submodules: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand All @@ -189,24 +200,19 @@ jobs:
artifact: sonic-swss-common.armhf
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/sonic-swss-common.armhf'
displayName: "Download sonic swss common deb packages"
- script: |
sudo dpkg -i libswsscommon_1.0.0_armhf.deb
sudo dpkg -i libswsscommon-dev_1.0.0_armhf.deb
workingDirectory: $(Pipeline.Workspace)
sudo dpkg -i sonic-swss-common.armhf/libswsscommon_1.0.0_armhf.deb
sudo dpkg -i sonic-swss-common.armhf/libswsscommon-dev_1.0.0_armhf.deb
displayName: "Install sonic swss common"
- checkout: self
submodules: true
- script: |
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
rm ../*.deb
dpkg-buildpackage -us -uc -b -j$(nproc)
cp ../*.deb $(Build.ArtifactStagingDirectory)
displayName: "Compile sonic linkmgrd"
- publish: $(System.DefaultWorkingDirectory)/
- publish: $(Build.ArtifactStagingDirectory)
artifact: sonic-linkmgrd.armhf
displayName: "Archive linkmgrd debian packages"

- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/linkmgrd-test-result.xml
pathToSources: $(System.DefaultWorkingDirectory)/sonic-linkmgr/


0 comments on commit c11a576

Please sign in to comment.