Skip to content

Commit 02817d8

Browse files
committed
Add Azure pipeline config
Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent 147d39f commit 02817d8

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

.azure-pipelines/build.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
parameters:
2+
- name: 'arch'
3+
type: string
4+
- name: 'pool'
5+
type: object
6+
default: {}
7+
- name: 'containerImage'
8+
type: string
9+
- name: 'codeCoverage'
10+
type: boolean
11+
default: false
12+
13+
jobs:
14+
- job:
15+
displayName: ${{ parameters.arch }}
16+
timeoutInMinutes: 60
17+
pool: ${{ parameters.pool }}
18+
19+
container:
20+
image: ${{ parameters.containerImage }}
21+
22+
steps:
23+
- ${{ if and(eq(parameters.arch, 'amd64'), parameters.codeCoverage) }}:
24+
- script: |
25+
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
26+
sudo dpkg -i packages-microsoft-prod.deb
27+
rm packages-microsoft-prod.deb
28+
sudo apt-get update
29+
sudo apt-get install -y apt-transport-https
30+
sudo apt-get install -y dotnet-sdk-6.0
31+
displayName: install .Net
32+
- script: |
33+
sudo apt-get install -y \
34+
libboost-system-dev \
35+
libboost-thread-dev \
36+
googletest \
37+
libgtest-dev \
38+
libgmock-dev \
39+
libhiredis-dev \
40+
libnl-3-dev \
41+
libnl-route-3-dev \
42+
libnl-genl-3-dev \
43+
libnl-nf-3-dev
44+
45+
displayName: "Install dependencies"
46+
- checkout: self
47+
clean: true
48+
submodules: true
49+
- task: DownloadPipelineArtifact@2
50+
inputs:
51+
source: specific
52+
project: build
53+
pipeline: 9
54+
${{ if eq(parameters.arch, 'amd64') }}:
55+
artifact: sonic-swss-common
56+
${{ else }}:
57+
artifact: sonic-swss-common.${{ parameters.arch }}
58+
runVersion: 'latestFromBranch'
59+
runBranch: 'refs/heads/master'
60+
path: '$(Build.SourcesDirectory)/sonic-swss-common'
61+
displayName: "Download sonic swss common deb packages"
62+
- script: |
63+
sudo dpkg -i sonic-swss-common/libswsscommon_1.0.0_${{ parameters.arch }}.deb
64+
sudo dpkg -i sonic-swss-common/libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
65+
displayName: "Install sonic swss common"
66+
- script: |
67+
rm ../*.deb
68+
dpkg-buildpackage -us -uc -b -j$(nproc)
69+
cp ../*.deb $(Build.ArtifactStagingDirectory)
70+
displayName: "Compile sonic dhcp-relay"
71+
- publish: $(Build.ArtifactStagingDirectory)
72+
artifact: sonic-dhcp-relay.${{ parameters.arch }}
73+
displayName: "Archive dhcp-relay debian packages"
74+
- ${{ if and(eq(parameters.arch, 'amd64'), parameters.codeCoverage) }}:
75+
- task: PublishCodeCoverageResults@1
76+
inputs:
77+
summaryFileLocation: dhcprelay-test-result.xml
78+
pathToSources: $(Build.SourcesDirectory)
79+
codeCoverageTool: 'Cobertura'

azure-pipelines.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# C/C++ with GCC
2+
# Build your C/C++ project with GCC using make.
3+
# Add steps that publish test results, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
5+
6+
trigger:
7+
branches:
8+
include:
9+
- "*"
10+
11+
jobs:
12+
- template: .azure-pipelines/build.yml
13+
parameters:
14+
arch: amd64
15+
pool:
16+
vmImage: 'ubuntu-20.04'
17+
codeCoverage: false
18+
containerImage: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye:latest
19+
- template: .azure-pipelines/build.yml
20+
parameters:
21+
arch: arm64
22+
pool: sonicbld-arm64
23+
containerImage: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye-arm64:latest
24+
- template: .azure-pipelines/build.yml
25+
parameters:
26+
arch: armhf
27+
pool: sonicbld-armhf
28+
containerImage: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye-armhf:latest
29+

azurepipelines-coverage.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage:
2+
status: # Code coverage status will be posted to pull requests based on targets defined below.
3+
comments: on # Off by default. When on, details about coverage for each file changed will be posted as a pull request comment.
4+
diff: # Diff coverage is code coverage only for the lines changed in a pull request.
5+
target: 60% # Set this to a desired percentage. Default is 70 percent

0 commit comments

Comments
 (0)