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
78 changes: 11 additions & 67 deletions .github/workflows/Build ThunderInterfaces on Linux.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,19 @@
name: Build ThunderInterfaces on Linux
name: Build ThunderInterfaces on Linux (R4_4)

permissions:
contents: read

on:
workflow_dispatch:
push:
branches: ["master"]
branches: ["R4_4"]
pull_request:
branches: ["master"]
workflow_call:

branches: ["R4_4"]

jobs:
Thunder:
uses: rdkcentral/Thunder/.github/workflows/Build Thunder on Linux.yml@master
uses: rdkcentral/Thunder/.github/workflows/Linux build template.yml@R4_4

ThunderInterfaces:
needs: Thunder

runs-on: ubuntu-latest

strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]

name: Build type - ${{matrix.build_type}}
steps:
- name: Install necessary packages
uses: nick-fields/retry@v2
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
pip install jsonref
sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev

- name: Checkout Thunder
uses: actions/checkout@v3
with:
path: Thunder
repository: rdkcentral/Thunder

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Thunder-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}

- name: Unpack files
run: |
tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz

- name: Checkout ThunderInterfaces
uses: actions/checkout@v3
with:
path: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces

- name: Build ThunderInterfaces
run: |
cmake -G Ninja -S ThunderInterfaces -B ${{matrix.build_type}}/build/ThunderInterfaces \
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules"
cmake --build ${{matrix.build_type}}/build/ThunderInterfaces --target install

- name: Tar files
run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}

- name: Upload
uses: actions/upload-artifact@v3
with:
name: ThunderInterfaces-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}.tar.gz
uses: ./.github/workflows/Linux build template.yml
121 changes: 121 additions & 0 deletions .github/workflows/Linux build template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Linux build template (R4_4)

permissions:
contents: read

on:
workflow_call:

jobs:
ThunderInterfaces:

runs-on: ubuntu-24.04

strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]
architecture: [32, 64]

# ----- Packages & artifacts -----
name: Build type - ${{matrix.build_type}}${{matrix.architecture == '32' && ' x86' || ''}}
steps:
- name: Prepare apt (add i386 if needed)
if: ${{ matrix.architecture == '32' }}
run: |
sudo dpkg --add-architecture i386

- name: Update apt indices (with retries)
shell: bash
run: |
set -euo pipefail
for attempt in {1..5}; do
if sudo apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout=30; then
break
fi
Comment thread
VeithMetro marked this conversation as resolved.
echo "apt-get update failed (attempt $attempt), retrying..."
sleep $((attempt*10))
done

- name: Install system dependencies
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
PKGS="python3-venv python3-pip build-essential cmake ninja-build libusb-1.0-0-dev"
if [ "${{ matrix.architecture }}" = "32" ]; then
PKGS="$PKGS zlib1g-dev:i386 libssl-dev:i386 libsbc-dev:i386 gcc-13-multilib g++-13-multilib"
else
PKGS="$PKGS zlib1g-dev libssl-dev libsbc-dev"
fi
for attempt in {1..4}; do
if sudo apt-get install -y --no-install-recommends $PKGS; then
break
fi
echo "apt-get install failed (attempt $attempt), cleaning up & retrying..."
sudo apt-get clean
sleep $((attempt*15))
done
Comment thread
VeithMetro marked this conversation as resolved.

- name: Set up Python environment
run: |
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install jsonref

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Thunder-${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}-artifact
path: ${{matrix.build_type}}

- name: Unpack files
run: |
tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz
rm ${{matrix.build_type}}/${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz

# ----- Regex & checkout -----
- name: Checkout ThunderInterfaces - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') }}
uses: actions/checkout@v4
with:
path: ThunderInterfaces
Comment thread
VeithMetro marked this conversation as resolved.
repository: rdkcentral/ThunderInterfaces
ref: R4_4

- name: Regex ThunderInterfaces
if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:')
id: thunderinterfaces
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=ThunderInterfaces:).*(?=\])'
Comment thread
VeithMetro marked this conversation as resolved.
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}

- name: Checkout ThunderInterfaces - ${{steps.thunderinterfaces.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:')
uses: actions/checkout@v4
with:
path: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces
ref: ${{steps.thunderinterfaces.outputs.first_match}}

# ----- Building & uploading -----
- name: Build ThunderInterfaces
run: |
source venv/bin/activate
cmake -G Ninja -S ThunderInterfaces -B ${{matrix.build_type}}/build/ThunderInterfaces \
-DCMAKE_CXX_FLAGS="-m${{matrix.architecture}}" \
-DCMAKE_C_FLAGS="-m${{matrix.architecture}}" \
Comment thread
VeithMetro marked this conversation as resolved.
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules"
cmake --build ${{matrix.build_type}}/build/ThunderInterfaces --target install

- name: Tar files
run: tar -czvf ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz ${{matrix.build_type}}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: ThunderInterfaces-${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}-artifact
path: ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz
Loading