From 308de11f4c87c661975cb5e0cd8bbab10bf9982c Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Tue, 16 Jan 2024 08:43:25 +0100 Subject: [PATCH 1/2] [Actions] Managing dependencies to make the workflows callable from different repos (#28) * Create Linux build template * Use the Linux build template * Main action does not need to be callable anymore * Changing the repo owner to be fixed since this workflow is callable now * Preparing for pull request --- .../Build ThunderLibraries on Linux.yml | 76 +----------------- .github/workflows/Linux build template.yml | 79 +++++++++++++++++++ 2 files changed, 81 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/Linux build template.yml diff --git a/.github/workflows/Build ThunderLibraries on Linux.yml b/.github/workflows/Build ThunderLibraries on Linux.yml index 57400da..d58a665 100644 --- a/.github/workflows/Build ThunderLibraries on Linux.yml +++ b/.github/workflows/Build ThunderLibraries on Linux.yml @@ -5,83 +5,11 @@ on: branches: ["main"] pull_request: branches: ["main"] - workflow_call: jobs: Thunder: - uses: rdkcentral/Thunder/.github/workflows/Build Thunder on Linux.yml@master + uses: VeithMetro/Thunder/.github/workflows/Linux build template.yml@development/actions ThunderLibraries: 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 ThunderLibraries - uses: actions/checkout@v3 - with: - path: ThunderLibraries - repository: ${{github.repository_owner}}/ThunderLibraries - - - name: Regex ThunderLibraries - if: contains(github.event.pull_request.body, '[Options:') - id: libs - uses: AsasInnab/regex-action@v1 - with: - regex_pattern: '(?<=\[Options:).*(?=\])' - regex_flags: 'gim' - search_string: ${{github.event.pull_request.body}} - - - name: Build ThunderLibraries - run: | - cmake -G Ninja -S ThunderLibraries -B ${{matrix.build_type}}/build/ThunderLibraries \ - -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \ - -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \ - -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \ - -DBROADCAST=ON \ - ${{steps.libs.outputs.first_match}} - cmake --build ${{matrix.build_type}}/build/ThunderLibraries --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: ThunderLibraries-${{matrix.build_type}}-artifact - path: ${{matrix.build_type}}.tar.gz + uses: VeithMetro/ThunderLibraries/.github/workflows/Linux build template.yml@development/actions diff --git a/.github/workflows/Linux build template.yml b/.github/workflows/Linux build template.yml new file mode 100644 index 0000000..b2d7318 --- /dev/null +++ b/.github/workflows/Linux build template.yml @@ -0,0 +1,79 @@ +name: Build ThunderLibraries on Linux + +on: + workflow_call: + +jobs: + ThunderLibraries: + + 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 ThunderLibraries + uses: actions/checkout@v3 + with: + path: ThunderLibraries + repository: WebPlatformForEmbedded/ThunderLibraries + + - name: Regex ThunderLibraries + if: contains(github.event.pull_request.body, '[Options:') + id: libs + uses: AsasInnab/regex-action@v1 + with: + regex_pattern: '(?<=\[Options:).*(?=\])' + regex_flags: 'gim' + search_string: ${{github.event.pull_request.body}} + + - name: Build ThunderLibraries + run: | + cmake -G Ninja -S ThunderLibraries -B ${{matrix.build_type}}/build/ThunderLibraries \ + -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \ + -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \ + -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \ + -DBROADCAST=ON \ + ${{steps.libs.outputs.first_match}} + cmake --build ${{matrix.build_type}}/build/ThunderLibraries --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: ThunderLibraries-${{matrix.build_type}}-artifact + path: ${{matrix.build_type}}.tar.gz From 23a3590ff7985f2cca847cf84a035a743fd01460 Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:29:16 +0100 Subject: [PATCH 2/2] [Actions] Using the already merged workflows instead of my forks (#30) * Using workflows from our repos instead of the ones on my forks * Prep for merging --- .github/workflows/Build ThunderLibraries on Linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build ThunderLibraries on Linux.yml b/.github/workflows/Build ThunderLibraries on Linux.yml index d58a665..e0b6126 100644 --- a/.github/workflows/Build ThunderLibraries on Linux.yml +++ b/.github/workflows/Build ThunderLibraries on Linux.yml @@ -8,8 +8,8 @@ on: jobs: Thunder: - uses: VeithMetro/Thunder/.github/workflows/Linux build template.yml@development/actions + uses: rdkcentral/Thunder/.github/workflows/Linux build template.yml@master ThunderLibraries: needs: Thunder - uses: VeithMetro/ThunderLibraries/.github/workflows/Linux build template.yml@development/actions + uses: WebPlatformForEmbedded/ThunderLibraries/.github/workflows/Linux build template.yml@main