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
96 changes: 96 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
build-essential ca-certificates \
cmake pkg-config clang-format \
libboost-all-dev \
curl wget git \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
libcurl4-openssl-dev \
jq netcat-openbsd \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

ARG NODE_VERSION="24.11.0"
ENV NVM_DIR="/usr/local/nvm"
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
ENV NODE_PATH="$NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules"
ENV PATH="$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH"

RUN mkdir -p /deps

ARG DEPS_GOOGLETEST_V="1.15.2"
RUN cd /deps \
&& dir="googletest-${DEPS_GOOGLETEST_V}" \
&& curl -sL https://github.com/google/googletest/releases/download/v${DEPS_GOOGLETEST_V}/$dir.tar.gz | tar xzf - \
&& cmake -B "build/$dir" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
"$dir" \
&& cmake --build "build/$dir" --target install \
&& rm -rf "build/$dir" "$dir"

ARG DEPS_NLOHMANN_JSON_V="3.11.3"
RUN cd /deps \
&& dir="nlohmann-json-${DEPS_NLOHMANN_JSON_V}" \
&& git clone --depth 1 --branch "v${DEPS_NLOHMANN_JSON_V}" "https://github.com/nlohmann/json" "$dir" \
&& cmake -B "build/$dir" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DJSON_BuildTests=OFF \
"$dir" \
&& cmake --build "build/$dir" --target install \
&& rm -rf "build/$dir" "$dir"

ARG DEPS_JSON_SCHEMA_VALIDATOR_V="2.3.0"
RUN cd /deps \
&& dir="json-schema-validator-${DEPS_JSON_SCHEMA_VALIDATOR_V}" \
&& curl -sL https://github.com/pboettch/json-schema-validator/archive/refs/tags/${DEPS_JSON_SCHEMA_VALIDATOR_V}.tar.gz | tar xzf - \
&& cmake -B "build/$dir" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DJSON_VALIDATOR_BUILD_TESTS=OFF \
-DJSON_VALIDATOR_BUILD_EXAMPLES=OFF \
"$dir" \
&& cmake --build "build/$dir" --target install \
&& rm -rf "build/$dir" "$dir"

ARG DEPS_WEBSOCKETPP_V="0.8.2"
RUN cd /deps \
&& dir="websocketpp-${DEPS_WEBSOCKETPP_V}" \
&& curl -sL https://github.com/zaphoyd/websocketpp/archive/refs/tags/${DEPS_WEBSOCKETPP_V}.tar.gz | tar xzf - \
&& cmake -B "build/$dir" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
"$dir" \
&& cmake --build "build/$dir" --target install \
&& rm -rf "build/$dir" "$dir"

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
python3-pip \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

RUN pip install --break-system-packages gcovr

# --- Transport should be always at the very end as it changes most often
ARG DEPS_TRANSPORT_V
RUN cd /deps \
&& dir="firebolt-native-transport-${DEPS_TRANSPORT_V}" \
&& curl -sL https://github.com/rdkcentral/firebolt-native-transport/releases/download/v${DEPS_TRANSPORT_V}/firebolt-native-transport-${DEPS_TRANSPORT_V}.tar.gz | tar xzf - \
&& cmake -B "build/$dir" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
"$dir" \
&& cmake --build "build/$dir" --target install \
&& rm -rf "build/$dir" "$dir"

WORKDIR /workspace

CMD ["/bin/bash"]
42 changes: 42 additions & 0 deletions .github/actions/setup-mock/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Setup Mock-Firebolt'
description: 'Sets up Mock-Firebolt and caches it.'
runs:
using: "composite"

steps:
- name: Generate Dependency Hash Key
id: cache-key
shell: bash
run: |
echo "hash=$( ( echo "${{ env.MOCK_SHA1SUM }}"; sha256sum "${{ env.MOCK_PATCH }}" | awk '{print $1}' ) | sha256sum | awk '{print $1}')" >> $GITHUB_OUTPUT

- name: Restore Dependency Cache
uses: actions/cache@v4
id: cache-restore
with:
path: ${{ env.MOCK_PATH }}
key: ${{ runner.os }}-mock-${{ steps.cache-key.outputs.hash }}

- name: Build and Install Mock-Firebolt
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Building Mock-Firebolt..."
git clone --depth 1 --branch main https://github.com/rdkcentral/mock-firebolt.git ${{ env.MOCK_PATH }}
cd ${{ env.MOCK_PATH }}
git fetch --shallow-since=2025-11-01
git checkout ${{ env.MOCK_SHA1SUM }}
git apply "${{ env.MOCK_PATCH }}"
cd server
npm ci
echo "Mock-Firebolt built and installed to ${{ env.MOCK_PATH }}"

- name: Cache Save Confirmation
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash
run: echo "New dependency cache will be saved."

outputs:
deps_cache_key:
description: "The cache key for the dependencies."
value: ${{ steps.cache-key.outputs.hash }}
58 changes: 58 additions & 0 deletions .github/mock-firebolt/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"validate": [
"method",
"params",
"response",
"events"
],
"multiUserConnections": "warn",
"bidirectional": true,
"supportedOpenRPCs": [
{
"name": "core",
"cliFlag": null,
"cliShortFlag": null,
"url_Note": "Can be changed to test different versions of the firebolt-open-rpc",
"fileName": "CORE-OPENRPC.json",
"enabled": true
},
{
"name": "mock",
"cliFlag": "mock",
"cliShortFlag": "m",
"fileName": "../../functional/mockOpenRpc.json",
"enabled": false
}
],
"supportedToAppOpenRPCs": [
{
"name": "coreToApp",
"cliFlag": null,
"cliShortFlag": null,
"url_Note": "URL for toApp OpenRPC (Firebolt 2.0 event/provider spec)",
"fileName": "APP-OPENRPC.json",
"enabled": true
},
{
"name": "mockToApp",
"cliFlag": "mockToApp",
"cliShortFlag": "mt",
"fileName": "../../functional/mockToAppOpenRpc.json",
"enabled": false
}
],
"eventConfig": {
"registrationMessage": {
"searchRegex": "(?=.*\\\"method\\\".*)(?=.*\\\"listen\\\":true.*).*\\.on\\S*",
"method": "$.method"
},
"unRegistrationMessage": {
"searchRegex": "(?=.*\\\"method\\\".*)(?=.*\\\"listen\\\":false.*).*\\.on\\S*",
"method": "$.method"
},
"registrationAck": "{\"jsonrpc\":\"2.0\",\"id\":{{registration.id}},\"result\":null}",
"unRegistrationAck": "{\"jsonrpc\":\"2.0\",\"id\":{{unRegistration.id}},\"result\":null}",
"event": "{\"result\":{{{resultAsJson}}},\"id\":{{registration.id}},\"jsonrpc\":\"2.0\"}",
"eventType": "Firebolt"
}
}
Loading