Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ci] Support to build sonic-swss-common #2685

Merged
merged 9 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
- checkout: self
clean: true
submodules: true
- checkout: sonic-swss-common
clean: true
- script: |
sudo apt-get update
sudo apt-get install -y libhiredis0.14 libhiredis-dev
Expand All @@ -72,20 +74,16 @@ jobs:
sudo apt-get install -y libteam-dev \
libteam5 \
libteamdctl0
sudo apt-get install -y libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-swss-common
artifact: ${{ parameters.swss_common_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libswsscommon_1.0.0_${{ parameters.arch }}.deb
libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
displayName: "Download sonic swss common deb packages"
- script: |
set -ex
git checkout $(BUILD_BRANCH)
./autogen.sh
dpkg-buildpackage -us -uc -b -j$(nproc)
sudo dpkg -i ../libswsscommon*.deb
workingDirectory: $(System.DefaultWorkingDirectory)/sonic-swss-common
displayName: "Build and isntall sonic-swss-common"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand Down Expand Up @@ -140,9 +138,12 @@ jobs:
export ENABLE_GCOV=y
fi
./autogen.sh
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
dpkg-buildpackage -us -uc -b -j$(nproc)
mkdir artifacts
cp ../*.deb artifacts/
workingDirectory: $(System.DefaultWorkingDirectory)/sonic-swss
displayName: "Compile sonic swss"
- publish: $(System.DefaultWorkingDirectory)/
- publish: $(System.DefaultWorkingDirectory)/sonic-swss/artifacts/
artifact: ${{ parameters.artifact_name }}
displayName: "Archive swss debian packages"
- publish: $(Build.ArtifactStagingDirectory)/
Expand Down
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ schedules:
- 201???
always: true

resources:
repositories:
- repository: sonic-swss-common
type: github
name: sonic-net/sonic-swss-common
endpoint: sonic-net

variables:
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
Expand Down