Skip to content
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
40 changes: 40 additions & 0 deletions .github/workflows/native_full_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: BT-Core Component Build in Native Environment

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
native-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
Comment on lines +11 to +13

steps:
# ----------------------------------------
# Checkout
# ----------------------------------------
- name: Checkout source
uses: actions/checkout@v6

# ----------------------------------------
# Setup scripts permission
# ----------------------------------------
- name: Make scripts executable
run: |
chmod +x build_dependencies.sh
chmod +x cov_build.sh

# ----------------------------------------
# Install dependencies
# ----------------------------------------
- name: Run bt-core dependency setup
run: ./build_dependencies.sh

# ----------------------------------------
# Build project
# ----------------------------------------
- name: Run bt-core native build
run: ./cov_build.sh

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +11 to +40
58 changes: 58 additions & 0 deletions build_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
set -e

echo "Installing system dependencies..."

apt-get update
apt-get install -y \
autoconf automake libtool pkg-config \
gcc g++ make \
libglib2.0-dev libdbus-1-dev libbluetooth-dev \
git
Comment on lines +6 to +11

WORKSPACE=$(pwd)

echo "Setting up telemetry stub..."

git clone https://github.com/rdkcentral/telemetry.git

mkdir -p ${WORKSPACE}/external/include
mkdir -p ${WORKSPACE}/external/lib

cp telemetry/include/telemetry_busmessage_sender.h ${WORKSPACE}/external/include/
cp telemetry/include/telemetry2_0.h ${WORKSPACE}/external/include/

cat << 'EOF' > telemetry_stub.c
int t2_init(void) { return 0; }
int t2_event_s(const char* n, const char* v) { return 0; }
int t2_event_f(const char* n, float v) { return 0; }
int t2_event_d(const char* n, double v) { return 0; }
EOF

gcc -shared -fPIC telemetry_stub.c \
-o ${WORKSPACE}/external/lib/libtelemetry_msgsender.so

echo "Setting up BlueZ legacy headers..."

git clone https://github.com/bluez/bluez.git

mkdir -p ${WORKSPACE}/external/include/bluetooth/audio
mkdir -p ${WORKSPACE}/external/include/bluetooth

git -C bluez checkout tags/4.101

cp bluez/audio/ipc.h \
${WORKSPACE}/external/include/bluetooth/audio/ipc.h

git -C bluez checkout tags/5.48

cp bluez/profiles/audio/a2dp-codecs.h \
${WORKSPACE}/external/include/bluetooth/audio/a2dp-codecs.h

cp bluez/lib/bluetooth.h \
${WORKSPACE}/external/include/bluetooth/bluetooth.h

sed -i '1i#include <stdbool.h>\n' \
${WORKSPACE}/external/include/bluetooth/audio/ipc.h

echo "Dependencies setup completed."
29 changes: 29 additions & 0 deletions cov_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e

WORKSPACE=$(pwd)

echo "Bootstrapping autotools..."

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf

echo "Configuring project..."

export CPPFLAGS="-I${WORKSPACE}/external/include"
export LDFLAGS="-L${WORKSPACE}/external/lib"
export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"
export LD_LIBRARY_PATH="${WORKSPACE}/external/lib"

ac_cv_header_telemetry_busmessage_sender_h=yes ./configure

echo "Building BT-Core..."

make -C src/bt-ifce -j$(nproc)
make -C src -j$(nproc)

echo "Build completed successfully."
Loading