Skip to content

Commit

Permalink
work flow test initial commit (rdkcentral#10)
Browse files Browse the repository at this point in the history
Co-authored-by: rafi <[email protected]>
  • Loading branch information
parvathika and cmuhammedrafi authored Sep 24, 2024
1 parent e366a6a commit ed59d2c
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/gnome_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: gnome_unit_test

on:
push:
branches: [ main, develop, 'release/**']
pull_request:
branches: [ main, develop, 'release/**']

env:
THUNDER_REF: "R4.4.1"

jobs:
unit-tests:
name: Build and run unit tests
runs-on: ubuntu-latest

steps:
- name: Configure cache
if: ${{ !env.ACT }}
id: cache
uses: actions/cache@v3
with:
path: |
build/Thunder
build/ThunderInterfaces
build/ThunderTools
install
!install/etc/WPEFramework/plugins
!install/usr/lib/wpeframework/plugins
key: ${{ runner.os }}-${{ env.THUNDER_REF }}

- name: Install packages
run: |
sudo apt update
sudo apt-get install -y pkg-config libglib2.0-dev libnm-dev libcurl4-openssl-dev ninja-build
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref

- name: Configure CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'

- name: Checkout thunder repositories
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/rdkcentral/ThunderTools ThunderTools --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/Thunder Thunder --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/ThunderInterfaces ThunderInterfaces --branch ${{ env.THUNDER_REF }}
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools" -B build/ThunderTools
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderTools --target install -j8
- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder" -B build/Thunder
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DBUILD_TYPE=Debug
-DBINDING=127.0.0.1
-DPORT=9998
&&
cmake --build build/Thunder --target install -j8
- name: Build ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces" -B build/ThunderInterfaces
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces --target install -j8
- name: Checkout networkmanager
uses: actions/checkout@v3
with:
path: networkmanager

- name: Build networkmanager with Gnome Proxy
run: >
cmake
-S "${{github.workspace}}/networkmanager"
-B build/GnomeNetworkmanager
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DENABLE_GNOME_NETWORKMANAGER=ON
&&
cmake --build build/GnomeNetworkmanager --target install -j8
118 changes: 118 additions & 0 deletions .github/workflows/rdk_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: rdk_unit_test

on:
push:
branches: [ main, develop, 'release/**']
pull_request:
branches: [ main, develop, 'release/**']

env:
THUNDER_REF: "R4.4.1"

jobs:
unit-tests:
name: Build and run unit tests
runs-on: ubuntu-latest

steps:
- name: Configure cache
if: ${{ !env.ACT }}
id: cache
uses: actions/cache@v3
with:
path: |
build/Thunder
build/ThunderInterfaces
build/ThunderTools
install
!install/etc/WPEFramework/plugins
!install/usr/lib/wpeframework/plugins
key: ${{ runner.os }}-${{ env.THUNDER_REF }}

- name: Install packages
run: |
sudo apt update
sudo apt-get install -y pkg-config libglib2.0-dev libnm-dev libcurl4-openssl-dev ninja-build
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref

- name: Configure CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'

- name: Checkout thunder repositories
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/rdkcentral/ThunderTools ThunderTools --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/Thunder Thunder --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/ThunderInterfaces ThunderInterfaces --branch ${{ env.THUNDER_REF }}
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools" -B build/ThunderTools
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderTools --target install -j8
- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder" -B build/Thunder
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DBUILD_TYPE=Debug
-DBINDING=127.0.0.1
-DPORT=9998
&&
cmake --build build/Thunder --target install -j8
- name: Build ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces" -B build/ThunderInterfaces
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces --target install -j8
- name: Checkout networkmanager
uses: actions/checkout@v3
with:
path: networkmanager

- name: Generate IARM headers
run: |
touch install/usr/lib/libIARMBus.so
mkdir -p install/usr/include/rdk/iarmbus
touch install/usr/include/rdk/iarmbus/libIARM.h
cd "${{github.workspace}}/networkmanager/Tests/"
mkdir -p headers/rdk/iarmbus
cd headers
touch rdk/iarmbus/libIARM.h rdk/iarmbus/libIBus.h
- name: Build networkmanager with RDK Proxy
run: >
cmake
-S "${{github.workspace}}/networkmanager"
-B build/RDKNetworkmanager
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DCMAKE_CXX_FLAGS="
-I ${{github.workspace}}/networkmanager/Tests/headers
-I ${{github.workspace}}/networkmanager/Tests/headers/rdk/iarmbus
--include ${{github.workspace}}/networkmanager/Tests/mocks/Iarm.h
"
&&
cmake --build build/RDKNetworkmanager --target install -j8
30 changes: 30 additions & 0 deletions Tests/mocks/Iarm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

#include <string>

typedef int IARM_EventId_t;

typedef enum _IARM_Result_t {
IARM_RESULT_SUCCESS,
IARM_RESULT_INVALID_PARAM,
IARM_RESULT_INVALID_STATE,
IARM_RESULT_IPCCORE_FAIL,
IARM_RESULT_OOM,
} IARM_Result_t;

#define IARM_BUS_DAEMON_NAME "Daemon"

typedef IARM_Result_t (*IARM_BusCall_t)(void* arg);
typedef void (*IARM_EventHandler_t)(const char* owner, IARM_EventId_t eventId, void* data, size_t len);

extern IARM_Result_t (*IARM_Bus_Init)(const char*);
extern IARM_Result_t (*IARM_Bus_Connect)();
extern IARM_Result_t (*IARM_Bus_IsConnected)(const char*,int*);
extern IARM_Result_t (*IARM_Bus_RegisterEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t);
extern IARM_Result_t (*IARM_Bus_UnRegisterEventHandler)(const char*,IARM_EventId_t);
extern IARM_Result_t (*IARM_Bus_RemoveEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t);
extern IARM_Result_t (*IARM_Bus_Call)(const char*,const char*,void*,size_t);
extern IARM_Result_t (*IARM_Bus_BroadcastEvent)(const char *,IARM_EventId_t,void *,size_t);
extern IARM_Result_t (*IARM_Bus_RegisterCall)(const char*,IARM_BusCall_t);
extern IARM_Result_t (*IARM_Bus_Call_with_IPCTimeout)(const char*,const char*,void*,size_t,int);

0 comments on commit ed59d2c

Please sign in to comment.