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
15 changes: 15 additions & 0 deletions .github/scripts/rtrouted.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install
export RBUS_BRANCH=main
mkdir -p $RBUS_INSTALL_DIR
cd $RBUS_ROOT
git clone https://github.com/rdkcentral/rbus
cmake -Hrbus -Bbuild/rbus -DCMAKE_INSTALL_PREFIX=${RBUS_INSTALL_DIR}/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug
make -C build/rbus && make -C build/rbus install
export PATH=${RBUS_INSTALL_DIR}/usr/bin:${PATH} && \
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib:${LD_LIBRARY_PATH}
nohup rtrouted -f -l DEBUG > /tmp/rtrouted_log.txt &
mkdir ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbuscore.so* ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib/
cp ${RBUS_INSTALL_DIR}/usr/lib/librtMessage.so* ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib/
47 changes: 28 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,57 @@ jobs:
runs-on: [ ubuntu-latest ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

# Install the dependent packages
- name: Install packages
run: |
sudo apt update
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev libcurl4-openssl-dev libtool gcovr
pip install codecov
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev libcurl4-openssl-dev libmsgpack-dev gcovr libtool libcjson-dev uuid-dev
pip install coverage

- name: Make Build Directory
run: mkdir build

- name: Get Sonarcloud Binaries
uses: xmidt-org/sonarcloud-installer-action@v1
with:
working-directory: build

- name: CMake
working-directory: build
run: |
cmake .. -DDISABLE_VALGRIND:BOOL=false

- name: Build

- name: Get rtrouted Binary
working-directory: build
run: |
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all test
../.github/scripts/rtrouted.sh

- name: Merge GCOV Reports for Sonarcloud
- name: Build
working-directory: build
run: |
gcovr --sonarqube coverage.xml -r ..
ps aux
export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install && \
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${LD_LIBRARY_PATH}
export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include:${RBUS_INSTALL_DIR}/usr/include/rbus
mkdir _install
mkdir _install/lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib
ARGS=-VV make all test # use this version for debugging

- name: Stop rtrouted
run: |
killall -9 rtrouted

- name: Upload SonarCloud
- name: Generate Coverage Report
working-directory: build
run: |
build/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings=.sonar-project.properties -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gcovr --xml coverage.xml -r .. || echo "Coverage generation skipped"

- name: Upload Codecov.io
uses: codecov/codecov-action@v1
if: always()
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v4.6.0
with:
directory: .
fail_ci_if_error: true
files: ./build/coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include_directories(${INCLUDE_DIR}
${INCLUDE_DIR}/trower-base64
${INCLUDE_DIR}/wrp-c
${INCLUDE_DIR}/libparodus
${INCLUDE_DIR}/rbus
)

# Compile options/flags
Expand Down Expand Up @@ -150,6 +151,40 @@ ExternalProject_Add(libparodus
add_library(liblibparodus STATIC SHARED IMPORTED)
add_dependencies(liblibparodus libparodus)

# cJSON external dependency (for RBUS)
#-------------------------------------------------------------------------------
if (NOT BUILD_GIT)
ExternalProject_Add(cJSON
PREFIX ${PREFIX_DIR}/cJSON
GIT_REPOSITORY https://github.com/DaveGamble/cJSON.git
GIT_TAG "39853e5148dad8dc5d32ea2b00943cf4a0c6f120"
CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
)
add_library(libcJSON STATIC IMPORTED)
add_dependencies(libcJSON cJSON)
endif()

# RBUS external dependency (if not in Yocto)
#-------------------------------------------------------------------------------
if (NOT BUILD_GIT)
ExternalProject_Add(rbus
DEPENDS cJSON
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/rbus
GIT_REPOSITORY https://github.com/rdkcentral/rbus.git
GIT_TAG main
CMAKE_ARGS += -DBUILD_FOR_DESKTOP=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF
)

add_library(librbuscore STATIC SHARED IMPORTED)
add_dependencies(librbuscore rbuscore)

add_library(librtMessage STATIC SHARED IMPORTED)
add_dependencies(librtMessage rtMessage)

add_library(librbus STATIC SHARED IMPORTED)
add_dependencies(librbus rbus)
endif ()

endif()

link_directories ( ${LIBRARY_DIR} ${LIBRARY_DIR64} ${COMMON_LIBRARY_DIR} ${MAIN_PROJ_COMMON_PATH} ${MAIN_PROJ_LIB_PATH} ${MAIN_PROJ_LIB64_PATH} )
Expand Down
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
set(PROJ_AKER aker)
set(SOURCES wrp_interface.c decode.c time.c schedule.c
process_data.c scheduler.c schedule_print.c
aker_md5.c md5.c aker_mem.c aker_help.c aker_msgpack.c aker_metrics.c)
aker_md5.c md5.c aker_mem.c aker_help.c aker_msgpack.c aker_metrics.c
aker_notification.c aker_rbus.c)

if (NOT BUILD_YOCTO)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -g -fprofile-arcs -ftest-coverage -O0")
Expand All @@ -34,6 +35,7 @@ if (NOT BUILD_YOCTO)
-lm
-lcimplog
-lpthread
-lrbus
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries (aker-cli -lrt ${CURL_LIBRARIES})
Expand All @@ -50,6 +52,7 @@ target_link_libraries (aker
-lm
-lcimplog
-lpthread
-lrbus
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries (aker rt)
Expand Down
Loading
Loading