diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..df48c75 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,119 @@ +name: build-cn10k + +on: + push: + schedule: + - cron: '0 0 * * 1' + +jobs: + ubuntu-cn10k-build: + name: ubuntu-cn10k-arm64 + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + include: + - arch: aarch64 + distro: ubuntu22.04 + compiler: gcc + library: static + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Generate cache keys + id: get_ref_keys + run: | + echo 'ccache=ccache-${{ matrix.distro }}-${{ matrix.compiler }}-${{ matrix.arch }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT + - name: Retrieve ccache cache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }} + restore-keys: | + ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main + - name: Extract version details + id: version + run: | + mkdir -p "${PWD}/artifacts" + git tag --points-at HEAD > /tmp/tags + [ -s /tmp/tags ] && PKG_POSTFIX= || PKG_POSTFIX=-latest + [ -s /tmp/tags ] && NIGHTLY=false || NIGHTLY=true + echo "PKG_VERSION_NAME=`cat VERSION`" >> "${PWD}/artifacts/env" + echo "DPDK_PKG_VERSION=`cat VERSION`" >> "${PWD}/artifacts/env" + echo "DPDK_BASE_PKG_VERSION=`cat DPDK_VERSION | awk -F'.' '{print $1"."$2}'`" >> "${PWD}/artifacts/env" + echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "${PWD}/artifacts/env" + echo "NIGHTLY=${NIGHTLY}" >> $GITHUB_OUTPUT + echo "DPDK_PKG_VERSION=${DPDK_PKG_VERSION}" >> $GITHUB_OUTPUT + - uses: robinraju/release-downloader@v1.10 + with: + repository: "MarvellEmbeddedProcessors/marvell-dpdk-test" + latest: ${{ steps.version.outputs.NIGHTLY }} + tag: ${{ steps.version.outputs.NIGHTLY == 'latest' && '' || steps.version.outputs.DPDK_PKG_VERSION }} + fileName: "*.deb" + - uses: uraimo/run-on-arch-action@v2.7.2 + name: Build DAO and generate package + id: build + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + githubToken: ${{ github.token }} + setup: | + mkdir -p ~/.ccache + dockerRunArgs: | + --volume "${PWD}/artifacts:/artifacts" + --volume "${HOME}/.ccache:/root/.ccache" + shell: /bin/bash + install: | + apt-get update -q -y + apt-get install -y build-essential gcc meson ccache git doxygen apt-utils + apt-get install -y libnl-3-dev libnl-route-3-dev libnl-xfrm-3-dev + apt-get install -y sphinx-common python3-sphinx-rtd-theme pkg-config + apt-get install -y libarchive-dev libbsd-dev libbpf-dev + apt-get install -y libfdt-dev libjansson-dev + apt-get install -y libpcap-dev libssl-dev ninja-build python3-pip + apt-get install -y python3-pyelftools python3-setuptools python3-wheel zlib1g-dev + run: | + source /artifacts/env + apt-get install -y ./"dpdk-${DPDK_BASE_PKG_VERSION}-cn10k${PKG_POSTFIX}_${DPDK_PKG_VERSION}_arm64.deb" + export CC='ccache gcc' + echo "cache_dir = /root/.ccache" > /root/.ccache/ccache.conf + ccache -p + pkg-config --list-all + meson build -Dplatform=cn10k --prefix="${PWD}/install" -Denable_kmods=false + ninja install -C build + mkdir -p "${PWD}/install/DEBIAN" + cd "${PWD}/install" + echo 'Package: dao-cn10k'$PKG_POSTFIX >> DEBIAN/control + echo 'Version: '$PKG_VERSION_NAME >> DEBIAN/control + echo 'Depends: dpdk-'$DPDK_BASE_PKG_VERSION'-cn10k'$PKG_POSTFIX' (= '$DPDK_PKG_VERSION')' >> DEBIAN/control + echo "Maintainer: Jerin Jacob (jerinj@marvell.com)" >> DEBIAN/control + echo "Architecture: arm64" >> DEBIAN/control + echo "Homepage: https://www.dpdk.org/" >> DEBIAN/control + echo "Description: DPU Accelerator offload for Marvell Octeon 10" >> DEBIAN/control + cd - + mv "${PWD}/install" "${PWD}/dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64" + dpkg --build "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64" + cp "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64.deb" /artifacts/. + - name: Export version name + id: artifacts + run: | + source "${PWD}/artifacts/env" + echo $PKG_VERSION_NAME + echo "PKG_VERSION_NAME=${PKG_VERSION_NAME}" >> "$GITHUB_OUTPUT" + echo $PKG_POSTFIX + echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "$GITHUB_OUTPUT" + [[ "$PKG_POSTFIX" == "-latest" ]] && TAG=latest || TAG=${PKG_VERSION_NAME} + echo "TAG=${TAG}" >> "$GITHUB_OUTPUT" + - name: Upload debian package as artifact + uses: actions/upload-artifact@v4.3.1 + with: + name: dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb + path: ${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb + - name: Release DPDK cn10k package + uses: softprops/action-gh-release@v2.0.4 + with: + tag_name: ${{ steps.artifacts.outputs.TAG }} + files: | + ${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb