Skip to content

Commit 6bcbae1

Browse files
build: add github action to build DAO
Add github action to build and generate debian package. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
1 parent 43b78ae commit 6bcbae1

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.github/workflows/build.yml

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: build-cn10k
2+
3+
on:
4+
push:
5+
schedule:
6+
- cron: '0 0 * * 1'
7+
8+
jobs:
9+
ubuntu-cn10k-build:
10+
name: ubuntu-cn10k-arm64
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
include:
17+
- arch: aarch64
18+
distro: ubuntu22.04
19+
compiler: gcc
20+
library: static
21+
22+
steps:
23+
- name: Checkout sources
24+
uses: actions/checkout@v4
25+
- name: Generate cache keys
26+
id: get_ref_keys
27+
run: |
28+
echo 'ccache=ccache-${{ matrix.distro }}-${{ matrix.compiler }}-${{ matrix.arch }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT
29+
- name: Retrieve ccache cache
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.ccache
33+
key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
34+
restore-keys: |
35+
${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
36+
- name: Extract version details
37+
id: version
38+
run: |
39+
mkdir -p "${PWD}/artifacts"
40+
git tag --points-at HEAD > /tmp/tags
41+
[ -s /tmp/tags ] && PKG_POSTFIX= || PKG_POSTFIX=-latest
42+
[ -s /tmp/tags ] && NIGHTLY=false || NIGHTLY=true
43+
echo "PKG_VERSION_NAME=`cat VERSION`" >> "${PWD}/artifacts/env"
44+
echo "DPDK_PKG_VERSION=`cat VERSION`" >> "${PWD}/artifacts/env"
45+
echo "DPDK_BASE_PKG_VERSION=`cat DPDK_VERSION | awk -F'.' '{print $1"."$2}'`" >> "${PWD}/artifacts/env"
46+
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "${PWD}/artifacts/env"
47+
echo "NIGHTLY=${NIGHTLY}" >> $GITHUB_OUTPUT
48+
echo "DPDK_PKG_VERSION=${DPDK_PKG_VERSION}" >> $GITHUB_OUTPUT
49+
- uses: robinraju/release-downloader@v1.10
50+
with:
51+
repository: "MarvellEmbeddedProcessors/marvell-dpdk-test"
52+
latest: ${{ steps.version.outputs.NIGHTLY }}
53+
tag: ${{ steps.version.outputs.NIGHTLY == 'true' && '' || steps.version.outputs.DPDK_PKG_VERSION }}
54+
fileName: "*.deb"
55+
- uses: uraimo/run-on-arch-action@v2.7.2
56+
name: Build DAO and generate package
57+
id: build
58+
with:
59+
arch: ${{ matrix.arch }}
60+
distro: ${{ matrix.distro }}
61+
githubToken: ${{ github.token }}
62+
setup: |
63+
mkdir -p ~/.ccache
64+
dockerRunArgs: |
65+
--volume "${PWD}/artifacts:/artifacts"
66+
--volume "${HOME}/.ccache:/root/.ccache"
67+
shell: /bin/bash
68+
install: |
69+
apt-get update -q -y
70+
apt-get install -y build-essential gcc meson ccache git doxygen apt-utils
71+
apt-get install -y build-essential ccache git software-properties-common
72+
add-apt-repository -y ppa:ubuntu-toolchain-r/test
73+
apt-get update -q -y
74+
apt-get install -y libnl-3-dev libnl-route-3-dev libnl-xfrm-3-dev
75+
apt-get install -y sphinx-common python3-sphinx-rtd-theme pkg-config
76+
apt-get install -y libarchive-dev libbsd-dev libbpf-dev
77+
apt-get install -y libfdt-dev libjansson-dev
78+
apt-get install -y libpcap-dev libssl-dev ninja-build python3-pip
79+
apt-get install -y python3-pyelftools python3-setuptools python3-wheel zlib1g-dev
80+
apt-get install -y gcc-13
81+
run: |
82+
source /artifacts/env
83+
apt-get install -y ./"dpdk-${DPDK_BASE_PKG_VERSION}-cn10k${PKG_POSTFIX}_${DPDK_PKG_VERSION}_arm64.deb"
84+
export CC='ccache gcc-13'
85+
echo "cache_dir = /root/.ccache" > /root/.ccache/ccache.conf
86+
ccache -p
87+
pkg-config --list-all
88+
meson build -Dplatform=cn10k --prefix="${PWD}/install" -Denable_kmods=false
89+
ninja install -C build
90+
mkdir -p "${PWD}/install/DEBIAN"
91+
cd "${PWD}/install"
92+
echo 'Package: dao-cn10k'$PKG_POSTFIX >> DEBIAN/control
93+
echo 'Version: '$PKG_VERSION_NAME >> DEBIAN/control
94+
echo 'Depends: dpdk-'$DPDK_BASE_PKG_VERSION'-cn10k'$PKG_POSTFIX' (= '$DPDK_PKG_VERSION')' >> DEBIAN/control
95+
echo "Maintainer: Jerin Jacob (jerinj@marvell.com)" >> DEBIAN/control
96+
echo "Architecture: arm64" >> DEBIAN/control
97+
echo "Homepage: https://www.dpdk.org/" >> DEBIAN/control
98+
echo "Description: DPU Accelerator offload for Marvell Octeon 10" >> DEBIAN/control
99+
cd -
100+
mv "${PWD}/install" "${PWD}/dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64"
101+
dpkg --build "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64"
102+
cp "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64.deb" /artifacts/.
103+
- name: Export version name
104+
id: artifacts
105+
run: |
106+
source "${PWD}/artifacts/env"
107+
echo $PKG_VERSION_NAME
108+
echo "PKG_VERSION_NAME=${PKG_VERSION_NAME}" >> "$GITHUB_OUTPUT"
109+
echo $PKG_POSTFIX
110+
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "$GITHUB_OUTPUT"
111+
[[ "$PKG_POSTFIX" == "-latest" ]] && TAG=latest || TAG=${PKG_VERSION_NAME}
112+
echo "TAG=${TAG}" >> "$GITHUB_OUTPUT"
113+
- name: Upload debian package as artifact
114+
uses: actions/upload-artifact@v4.3.1
115+
with:
116+
name: dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
117+
path: ${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
118+
- name: Release DPDK cn10k package
119+
uses: softprops/action-gh-release@v2.0.4
120+
with:
121+
tag_name: ${{ steps.artifacts.outputs.TAG }}
122+
files: |
123+
${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
124+
- name: Dispatch package update event
125+
run: |
126+
curl -L \
127+
-X POST \
128+
-H "Accept: application/vnd.github+json" \
129+
-H "Authorization: Bearer ${{ secrets.PPA_REPO_SECRET }}" \
130+
-H "X-GitHub-Api-Version: 2022-11-28" \
131+
https://api.github.com/repos/marvellembeddedprocessors/packages/dispatches \
132+
-d '{"event_type":"dispatch-event", "client_payload": {"message": "${{ steps.artifacts.outputs.TAG }}"}}'

0 commit comments

Comments
 (0)