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
1 change: 0 additions & 1 deletion .github/scripts/rtrouted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ 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/
cp ${RBUS_INSTALL_DIR}/usr/lib/libcjson.so ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib/
33 changes: 12 additions & 21 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: CI

on:
pull_request_target:
pull_request:
push:
paths-ignore:
- 'AUTHORS'
Expand All @@ -15,32 +15,28 @@ on:
tags-ignore:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
- master

jobs:
test:
name: Unit Tests
runs-on: [ ubuntu-20.04 ]
runs-on: [ ubuntu-latest ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- 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 libmsgpack-dev gcovr libtool
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev libmsgpack-dev gcovr libtool libcjson-dev uuid-dev
pip install coverage

- name: Make Build Directory
run: mkdir build

- name: Get Sonarcloud Binaries
uses: sonarsource/sonarcloud-github-c-cpp@v2

- name: CMake
working-directory: build
run: |
Expand All @@ -63,26 +59,21 @@ jobs:
mkdir _install
mkdir _install/lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib
build-wrapper-linux-x86-64 --out-dir bw-output make all test
make all test

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

- name: Merge GCOV Reports for Sonarcloud
- name: Generate Coverage Report
working-directory: build
run: |
gcovr --sonarqube coverage.xml -r ..

- name: Upload SonarCloud
run: |
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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
if: always()
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v4.6.0
with:
directory: .
flags: unittests
fail_ci_if_error: true
files: ./build/coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ExternalProject_Add(cjwt
GIT_REPOSITORY https://github.com/Comcast/cjwt.git
GIT_TAG "1b023c41bb2d6dbbf493c202ed81f06c84d5b51b"
#GIT_TAG "1.0.1"
CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF
CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF -DCMAKE_C_FLAGS=-Wno-deprecated-declarations
)
add_library(libcjwt STATIC SHARED IMPORTED)
add_dependencies(libcjwt cjwt)
Expand All @@ -235,6 +235,10 @@ ExternalProject_Add(ucresolv
GIT_REPOSITORY https://github.com/Comcast/libucresolv.git
GIT_TAG "1.0.0"
CMAKE_ARGS += -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
PATCH_COMMAND
${CMAKE_COMMAND} -E echo "Patching ucresolv: removing dn_expand macro"
COMMAND sed -i "/__dn_expand/d" ${CMAKE_CURRENT_SOURCE_DIR}/build/_prefix/ucresolv/src/ucresolv/src/ucresolv.h
COMMAND sed -i "/__dn_expand/d" ${CMAKE_CURRENT_SOURCE_DIR}/build/_prefix/ucresolv/src/ucresolv/include/resolv/resolv.h
)
add_library(libucresolv STATIC SHARED IMPORTED)
add_dependencies(libucresolv ucresolv)
Expand Down
7 changes: 7 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,14 @@ set(XMIDT_SRC ${XMIDT_SRC}
../src/client_list.c
../src/spin_thread.c
../src/partners_check.c
../src/token.c

)

if (PARODUS_SECERT_ENABLE)
set(XMIDT_SRC ${XMIDT_SRC} ../src/rdkconfig_generic)
endif (PARODUS_SECERT_ENABLE)

if (ENABLE_WEBCFGBIN)
set(XMIDT_SRC ${XMIDT_SRC} ../src/upstream_rbus.c ../src/xmidtsend_rbus.c)
endif (ENABLE_WEBCFGBIN)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_crud_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void test_retrieveFromMemoryFailure()
{
int ret = -1;
cJSON *jsonresponse;
ParodusCfg cfg;
ParodusCfg cfg={0};
set_parodus_cfg(&cfg);
ret = retrieveFromMemory("hw-model", &jsonresponse );
assert_int_equal (ret, -1);
Expand Down
Loading