-
Notifications
You must be signed in to change notification settings - Fork 82
[Actions][R4_4] Add workflows to build ThunderInterfaces on Linux #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+132
−67
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| 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 |
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
| 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 | ||
| 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 | ||
|
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 | ||
|
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:).*(?=\])' | ||
|
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}}" \ | ||
|
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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.