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
30 changes: 30 additions & 0 deletions .github/workflows/native-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Webcfg Component in Native Environment

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-webcfg-on-pr:
name: Build webcfg component in github rdkcentral
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: native build
run: |
# Trust the workspace
git config --global --add safe.directory '*'
# Pull the latest changes for the native build system
git submodule update --init --recursive --remote
# Build component
chmod +x build_tools_workflows/cov_docker_script/build_native.sh
./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)"
env:
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "build_tools_workflows"]
path = build_tools_workflows
url = https://github.com/rdkcentral/build_tools_workflows
branch = develop
1 change: 1 addition & 0 deletions build_tools_workflows
Submodule build_tools_workflows added at f42cb2
3 changes: 3 additions & 0 deletions cov_docker_script/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 🔧 Coverity Native Build System for RDK-B Components

The documentation and source for the RDK-B native build system has been centralized in [rdkcentral/build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/blob/develop/cov_docker_script/README.md)
36 changes: 36 additions & 0 deletions cov_docker_script/build_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -x
set -e
##############################
GITHUB_WORKSPACE="${PWD}"
ls -la ${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}

############################
# Install CMake 3.22 or higher (required by CMakeLists.txt)
CMAKE_VERSION="3.22.6"
CMAKE_DIR="cmake-${CMAKE_VERSION}-linux-x86_64"

# Check if cmake needs upgrade
NEED_CMAKE_INSTALL=false
if ! command -v cmake &> /dev/null; then
echo "CMake not found, will install ${CMAKE_VERSION}"
NEED_CMAKE_INSTALL=true
else
CURRENT_CMAKE_VERSION=$(cmake --version | head -n1 | awk '{print $3}')
REQUIRED_VERSION="3.22"
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$CURRENT_CMAKE_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
echo "Current CMake version $CURRENT_CMAKE_VERSION is less than required $REQUIRED_VERSION"
NEED_CMAKE_INSTALL=true
fi
fi

if [ "$NEED_CMAKE_INSTALL" = true ]; then
echo "Installing CMake ${CMAKE_VERSION}..."
wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_DIR}.tar.gz
tar -xzf ${CMAKE_DIR}.tar.gz
cp -rf ${CMAKE_DIR}/bin/* /usr/local/bin/
cp -rf ${CMAKE_DIR}/share/* /usr/local/share/
rm -rf ${CMAKE_DIR} ${CMAKE_DIR}.tar.gz
echo "CMake ${CMAKE_VERSION} installed successfully"
fi
25 changes: 25 additions & 0 deletions cov_docker_script/component_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"_comment": "Component Build Configuration for Coverity/Native Builds",
"_version": "2.0",
"_description": "Defines dependencies and build settings for the native component",
"dependencies": {
},
"native_component": {
"name": "webcfg",
"pre_build_commands": [
{
"command": "chmod +x cov_docker_script/build_dependencies.sh"
},
{
"description": "Check Cmake version",
"command": "./cov_docker_script/build_dependencies.sh"
}
],
"build": {
"type": "cmake",
"build_dir": "build",
"cmake_flags": "-DWEBCONFIG_BIN_SUPPORT:BOOL=true -DWAN_FAILOVER_SUPPORTED:BOOL=true",
"parallel_make" : "false"
}
}
}
Loading