Skip to content

Merge pull request #1807 from rdkcentral/development/accept-pascalcas… #2369

Merge pull request #1807 from rdkcentral/development/accept-pascalcas…

Merge pull request #1807 from rdkcentral/development/accept-pascalcas… #2369

Workflow file for this run

name: Test Thunder
on:
workflow_dispatch:
push:
branches: ["master"]
paths-ignore:
- 'doc/**'
- 'docs/**'
- 'ReleaseNotes/**'
pull_request:
branches: ["master"]
paths-ignore:
- 'doc/**'
- 'docs/**'
- 'ReleaseNotes/**'
jobs:
Thunder:
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]
shared_libs: [ON, OFF]
env:
lib: LD_LIBRARY_PATH=${{github.workspace}}/${{matrix.build_type}}/install/usr/lib:$LD_LIBRARY_PATH
path: PATH=${{github.workspace}}/${{matrix.build_type}}/install/usr/bin:$PATH
name: Testing - ${{matrix.shared_libs == 'OFF' && 'Static ' || ''}}${{matrix.build_type}}
steps:
# ----- Installing packages -----
- name: Install necessary packages
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 10
command: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
sudo apt-get update
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev libgtest-dev
python3 -m venv venv
source venv/bin/activate
pip install jsonref
# ----- Checkout & DependsOn Regex -----
# -------------- Thunder ---------------
- name: Checkout Thunder - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=Thunder:') }}
uses: actions/checkout@v4
with:
path: Thunder
repository: rdkcentral/Thunder
- name: Regex Thunder
if: contains(github.event.pull_request.body, '[DependsOn=Thunder:')
id: thunder
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=Thunder:).*(?=\])'
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}
- name: Checkout Thunder - ${{steps.thunder.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=Thunder:')
uses: actions/checkout@v4
with:
path: Thunder
repository: rdkcentral/Thunder
ref: ${{steps.thunder.outputs.first_match}}
# -------------- ThunderTools -------------
- name: Checkout ThunderTools - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderTools:') }}
uses: actions/checkout@v4
with:
path: ThunderTools
repository: rdkcentral/ThunderTools
- name: Regex ThunderTools
if: contains(github.event.pull_request.body, '[DependsOn=ThunderTools:')
id: tools
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=ThunderTools:).*(?=\])'
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}
- name: Checkout ThunderTools - ${{steps.tools.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderTools:')
uses: actions/checkout@v4
with:
path: ThunderTools
repository: rdkcentral/ThunderTools
ref: ${{steps.tools.outputs.first_match}}
# ----- Building -----
- name: Install generators
run: |
source venv/bin/activate
cmake -G Ninja -S ThunderTools -B ${{matrix.build_type}}/build/ThunderTools \
-DCMAKE_INSTALL_PREFIX=${{matrix.build_type}}/install/usr
cmake --build ${{matrix.build_type}}/build/ThunderTools --target install
- name: Build Thunder
run: |
source venv/bin/activate
cmake -G Ninja -S Thunder -B ${{matrix.build_type}}/build/Thunder \
-DBINDING="127.0.0.1" \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.shared_libs}} \
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
-DDATA_PATH="${PWD}/${{matrix.build_type}}/install/usr/share/WPEFramework" \
-DPERSISTENT_PATH="${PWD}/${{matrix.build_type}}/install/var/wpeframework" \
-DPORT="55555" \
-DPROXYSTUB_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/proxystubs" \
-DSYSTEM_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/plugins" \
-DVOLATILE_PATH="tmp" \
-DBUILD_TESTS=ON
cmake --build ${{matrix.build_type}}/build/Thunder --target install
# ----- Running tests -----
- name: Run IPTestAdministrator unit test
run: ${{env.path}} ${{env.lib}} Thunder_test_tests
- name: Run core unit tests
run: ${{env.path}} ${{env.lib}} Thunder_test_core
# ----- Uploading artifact -----
- name: Tar files
run: tar -czvf ${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}.tar.gz ${{matrix.build_type}}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Thunder-${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}-artifact
path: ${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}.tar.gz