Skip to content

Commit a920d30

Browse files
Fix: fix cicd builds
CiCd setup is broken due to the actions failing to build the project. Fix via switching building to the script.
1 parent b319ccc commit a920d30

File tree

5 files changed

+130
-30
lines changed

5 files changed

+130
-30
lines changed

.github/path_filters.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ build: &build
1818
- kahawai.json
1919
- meson.build
2020
- meson_options.txt
21+
- .github/workflows/ubuntu_build.yml
2122
- VERSION
2223

2324
windows_gtest: &windows_gtest

.github/scripts/setup_environment.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
6+
7+
function ubuntu_install_dependencies() {
8+
echo "1.1. Install the build dependency from OS software store"
9+
10+
apt-get update
11+
apt-get install -y \
12+
git \
13+
gcc \
14+
meson \
15+
python3 \
16+
python3-pip \
17+
pkg-config \
18+
libnuma-dev \
19+
libjson-c-dev \
20+
libpcap-dev \
21+
libgtest-dev \
22+
libssl-dev \
23+
systemtap-sdt-dev \
24+
llvm \
25+
clang \
26+
libsdl2-dev \
27+
libsdl2-ttf-dev \
28+
29+
# CiCd only
30+
apt install -y python3-venv sudo wget
31+
python3 -m venv /tmp/mtl-venv
32+
. /tmp/mtl-venv/bin/activate
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "Your Name"
35+
36+
pip install --upgrade pip
37+
pip install pyelftools ninja
38+
39+
sudo apt-get install -y linux-headers-$(uname -r)
40+
}
41+
42+
if [ -f /etc/os-release ]; then
43+
. /etc/os-release
44+
case "$ID" in
45+
ubuntu)
46+
echo "Detected OS: Ubuntu"
47+
ubuntu_install_dependencies
48+
;;
49+
centos)
50+
echo "Detected OS: CentOS"
51+
echo "For now unsuported OS, please use Ubuntu"
52+
exit 2
53+
;;
54+
rhel)
55+
echo "Detected OS: RHEL"
56+
echo "For now unsuported OS, please use Ubuntu"
57+
exit 2
58+
;;
59+
rockos|rocky)
60+
echo "Detected OS: Rocky Linux"
61+
echo "For now unsuported OS, please use Ubuntu"
62+
exit 2
63+
;;
64+
*)
65+
echo "OS not recognized: $ID"
66+
echo "For now unsuported OS, please use Ubuntu"
67+
exit 2
68+
;;
69+
esac
70+
else
71+
echo "/etc/os-release not found. Cannot determine OS."
72+
exit 2
73+
fi
74+
75+
if [ "${BUILD_DPDK}" == "1" ]; then
76+
echo "2. DPDK build and install"
77+
bash "$(dirname "$0")/../../script/build_dpdk.sh"
78+
fi
79+
80+
if [ "${INSTALL_E810_DRIVER}" == "1" ]; then
81+
echo "3. E810 driver build and install"
82+
bash "$(dirname "$0")/../../script/build_e810_driver.sh"
83+
fi
84+
85+

.github/workflows/base_build.yml renamed to .github/workflows/ubuntu_build.yml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Base Build
1+
name: Ubuntu build
22

33
on:
44
# allow manually trigger
@@ -14,8 +14,7 @@ on:
1414

1515
permissions:
1616
contents: read
17-
env:
18-
DPDK_VERSION: 25.03
17+
1918
jobs:
2019
changes:
2120
runs-on: ubuntu-latest
@@ -25,7 +24,6 @@ jobs:
2524
changed: ${{ steps.filter.outputs.ubuntu_build == 'true' }}
2625
steps:
2726
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28-
2927
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
3028
id: filter
3129
with:
@@ -55,32 +53,12 @@ jobs:
5553
source: '.'
5654
extensions: 'hpp,h,cpp,c,cc'
5755

58-
- name: checkout dpdk repo
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60-
with:
61-
repository: 'DPDK/dpdk'
62-
ref: v${{ env.DPDK_VERSION }}
63-
path: dpdk
64-
65-
- name: Install the build dependency
66-
run: |
67-
apt-get update -y
68-
apt-get install -y sudo git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev systemtap-sdt-dev llvm clang
69-
apt-get install -y doxygen
70-
apt-get install -y make m4 clang llvm zlib1g-dev libelf-dev libcap-ng-dev libcap2-bin gcc-multilib
71-
72-
- name: Build DPDK from source
73-
working-directory: dpdk
74-
run: |
75-
meson build
76-
ninja -C build
77-
cd build
78-
sudo ninja install
79-
- name: Git config
80-
working-directory: "${{ github.workspace }}"
56+
- name: Install the build dependencies
57+
env:
58+
INSTALL_DPDK: 1
59+
INSTALL_E810_DRIVER: 1
8160
run: |
82-
git config --global user.email "[email protected]"
83-
git config --global user.name "Your Name"
61+
.github/scripts/setup_environment.sh
8462
8563
- name: Build
8664
working-directory: "${{ github.workspace }}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> [!TIP]
44
> [Full Documentation](https://openvisualcloud.github.io/Media-Transport-Library/README.html) for [Media Transport Library](https://openvisualcloud.github.io/Media-Transport-Library/README.html).
5-
[![Base build](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/base_build.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/base_build.yml)
5+
[![Ubuntu build](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build.yml)
66
[![Test](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build_with_gtest.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build_with_gtest.yml)
77
[![OpenSSF
88
Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenVisualCloud/Media-Transport-Library/badge)](https://api.securityscorecards.dev/projects/github.com/OpenVisualCloud/Media-Transport-Library)

script/build_e810_driver.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
# Copyright 2025 Intel Corporation
5+
6+
set -e
7+
8+
download_mirror=843928
9+
script_name=$(basename "$0")
10+
script_path=$(readlink -qe "$0")
11+
script_folder=${script_path/$script_name/}
12+
cd "${script_folder}"
13+
14+
if [ -n "$1" ]; then
15+
e810_driver_ver=$1
16+
else
17+
e810_driver_ver=1.16.3
18+
fi
19+
20+
echo "Building e810 driver version: $e810_driver_ver form mirror $download_mirror"
21+
22+
wget "https://downloadmirror.intel.com/${download_mirror}/ice-${e810_driver_ver}.tar.gz"
23+
tar xvzf ice-1.16.3.tar.gz
24+
cd ice-1.16.3
25+
26+
git init
27+
git add .
28+
git commit -m "init version ${e810_driver_ver}"
29+
git am ../../patches/ice_drv/${e810_driver_ver}/*.patch
30+
31+
cd src
32+
make
33+
sudo make install
34+
sudo rmmod ice
35+
sudo modprobe ice
36+
cd -

0 commit comments

Comments
 (0)