RDKEMW-10792 : Added support for syslog, different format and etc (#42) #1092
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: l1-tests | |
| on: | |
| push: | |
| branches: [ main, 'release/**', develop, 'topic/**', 'support/**' ] | |
| pull_request: | |
| branches: [ main, 'release/**', develop, 'topic/**', 'support/**' ] | |
| env: | |
| WORK_DIR: ${{github.workspace}} | |
| DEP_LIB: ${{github.workspace}}/dep_lib | |
| RDKLOGGER_ROOT: ${{github.workspace}}/Rdklogger | |
| LD_LIBRARY_PATH: ${{github.workspace}}/install/lib | |
| PKG_CONFIG_PATH: ${{github.workspace}}/install/lib/pkgconfig | |
| RDKLOGGER_PREFIX: ${{github.workspace}}/install | |
| jobs: | |
| l1-tests: | |
| name: Build rdk_logger with dependecies and execute L1 tests | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| compiler: [ gcc, clang ] | |
| coverage: [ with-coverage, without-coverage ] | |
| exclude: | |
| - compiler: clang | |
| coverage: with-coverage | |
| - compiler: clang | |
| coverage: without-coverage | |
| - compiler: gcc | |
| coverage: without-coverage | |
| steps: # The list of steps to execute | |
| - name: Install packages | |
| run: > | |
| sudo apt update | |
| && | |
| sudo apt install -y build-essential | |
| && | |
| sudo apt install -y cmake | |
| && | |
| sudo apt install -y tree automake libsqlite3-dev libcurl4-openssl-dev valgrind libgtest-dev lcov clang libsystemd-dev libboost-all-dev libwebsocketpp-dev meson libcunit1 libcunit1-dev | |
| - name: Build gtest | |
| run: | | |
| cd /usr/src/gtest | |
| sudo cmake CMakeLists.txt | |
| sudo make | |
| sudo cp lib/*.a /usr/lib | |
| - name: Checkout rdkcentral/rdk_logger | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: rdkcentral/rdk_logger | |
| github-server-url: https://github.com/rdkcentral/rdk_logger | |
| path: "${{env.RDKLOGGER_ROOT}}" | |
| - name: Build rdk_logger | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p ${{env.DEP_LIB}} | |
| cd ${{env.DEP_LIB}} | |
| if [ ! -f log4c-1.2.3.tar.gz ] | |
| then | |
| wget https://sourceforge.net/projects/log4c/files/log4c/1.2.3/log4c-1.2.3.tar.gz | |
| fi | |
| if [ ! -f log4c-1.2.3 ] | |
| then | |
| tar -xzf log4c-1.2.3.tar.gz | |
| fi | |
| cd "log4c-1.2.3" | |
| ./configure "--prefix=${{github.workspace}}/install" | |
| make | |
| make install | |
| echo "\"completed log4c build and installed library\"" | |
| mkdir -p ${{env.RDKLOGGER_ROOT}} | |
| cd ${{env.RDKLOGGER_ROOT}} | |
| aclocal -I cfg | |
| libtoolize --automake | |
| autoheader | |
| automake --foreign --add-missing | |
| rm -f configure | |
| autoconf | |
| export ac_cv_func_malloc_0_nonnull=yes | |
| export ac_cv_func_memset=yes | |
| # Enable coverage flags if applicable | |
| if [ "${{matrix.coverage}}" = "with-coverage" ]; then | |
| export CFLAGS="-DLOGMILESTONE=ON -DONBOARDING_FILE=ON --coverage" | |
| export CXXFLAGS="-DLOGMILESTONE=ON -DONBOARDING_FILE=ON --coverage" | |
| export LDFLAGS="--coverage" | |
| fi | |
| ./configure "--prefix=${{github.workspace}}/install" | |
| make | |
| make install | |
| - name: Build and execute L1 unittesting for rdk_logger | |
| run: | | |
| mkdir -p /opt/logs | |
| sudo touch /opt/logs/rdk_milestones.log | |
| sudo chmod 666 /opt/logs/rdk_milestones.log | |
| mkdir -p ${{env.RDKLOGGER_ROOT}}/unittests | |
| UNITTESTS="${{env.RDKLOGGER_ROOT}}/unittests" | |
| cp ${{github.workspace}}/install/bin/rdklogctrl ${UNITTESTS}/ | |
| cd ${UNITTESTS} | |
| if [ "${{matrix.coverage}}" = "with-coverage" ]; then | |
| cmake -B build -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install/usr -DDEP_LIB_PATH=${{env.LD_LIBRARY_PATH}} -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_C_FLAGS="--coverage -DLOGMILESTONE=ON" | |
| else | |
| cmake -B build -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install/usr -DDEP_LIB_PATH=${{env.LD_LIBRARY_PATH}} -DCMAKE_VERBOSE_MAKEFILE=ON | |
| fi | |
| make -C build | |
| cmake --install build | |
| ./build/rdk_logger_gtest | |
| - name: Collect coverage report | |
| if: ${{ matrix.coverage == 'with-coverage' }} | |
| run: | | |
| lcov --directory ${{env.RDKLOGGER_ROOT}}/src --capture --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' "${{env.RDKLOGGER_PREFIX}}/*" --output-file coverage.info | |
| - name: Generate the html report | |
| run: | | |
| genhtml coverage.info --output-directory /tmp/coverage_report | |
| - name: Upload coverage report | |
| if: ${{ matrix.coverage == 'with-coverage' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: /tmp/coverage_report |