Skip to content

test

test #8

Workflow file for this run

name: rdk_unit_test
on:
push:
branches: [ main, develop, 'release/**']
pull_request:
branches: [ main, develop, 'release/**']
env:
BUILD_TYPE: Debug
THUNDER_REF: "R4.4.1"
THUNDER_TOOLS_REF: "R4.4.1"
INTERFACES_REF: "R4.4.1"
jobs:
unit-tests:
name: Build and run unit tests
runs-on: ubuntu-latest
steps:
- name: Set up 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 }}-${{ env.INTERFACES_REF }}
- name: Install packages
run: |
sudo apt update
sudo apt install -y pkg-config ninja-build libssl-dev libcurl4-openssl-dev
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref
- name: Set up CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: Checkout ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderTools
path: ThunderTools
ref: ${{env.THUNDER_TOOLS_REF}}
- name: Checkout Thunder
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}
- name: Checkout ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderInterfaces
path: ThunderInterfaces
ref: ${{env.INTERFACES_REF}}
- name: Checkout networkmanager
uses: actions/checkout@v3
with:
path: networkmanager
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools"
-B build/ThunderTools
-DEXCEPTIONS_ENABLE=ON
-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 -j8
&&
cmake --install build/ThunderTools
- 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=${{env.BUILD_TYPE}}
-DBINDING=127.0.0.1
-DPORT=55555
-DEXCEPTIONS_ENABLE=ON
&&
cmake --build build/Thunder -j8
&&
cmake --install build/Thunder
- name: Build ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces"
-B build/ThunderInterfaces
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces -j8
&&
cmake --install build/ThunderInterfaces
- name: Generate external 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"
-I ${{github.workspace}}/networkmanager/Tests/headers
-I ${{github.workspace}}/networkmanager/Tests/headers/rdk/iarmbus"
-I ${{github.workspace}}networkmanager/Tests/mocks"
-DENABLE_NETWORKMANAGER_UNIT_TEST=ON
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
&&
cmake --build build/RDKNetworkmanager --target install -j8