|
| 1 | +name: Build ThunderLibraries on Linux |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["main"] |
| 6 | + pull_request: |
| 7 | + branches: ["main"] |
| 8 | + workflow_call: |
| 9 | + |
| 10 | +jobs: |
| 11 | + Thunder: |
| 12 | + uses: rdkcentral/Thunder/.github/workflows/Build Thunder on Linux.yml@master |
| 13 | + |
| 14 | + ThunderLibraries: |
| 15 | + needs: Thunder |
| 16 | + |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + build_type: [Debug, Release, MinSizeRel] |
| 22 | + |
| 23 | + name: Build type - ${{matrix.build_type}} |
| 24 | + steps: |
| 25 | + - name: Install necessary packages |
| 26 | + uses: nick-fields/retry@v2 |
| 27 | + with: |
| 28 | + timeout_minutes: 10 |
| 29 | + max_attempts: 10 |
| 30 | + command: | |
| 31 | + sudo gem install apt-spy2 |
| 32 | + sudo apt-spy2 fix --commit --launchpad --country=US |
| 33 | + sudo apt-get update |
| 34 | + sudo apt install python3-pip |
| 35 | + pip install jsonref |
| 36 | + sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev |
| 37 | +
|
| 38 | + - name: Checkout Thunder |
| 39 | + uses: actions/checkout@v3 |
| 40 | + with: |
| 41 | + path: Thunder |
| 42 | + repository: rdkcentral/Thunder |
| 43 | + |
| 44 | + - name: Download artifacts |
| 45 | + uses: actions/download-artifact@v3 |
| 46 | + with: |
| 47 | + name: Thunder-${{matrix.build_type}}-artifact |
| 48 | + path: ${{matrix.build_type}} |
| 49 | + |
| 50 | + - name: Unpack files |
| 51 | + run: | |
| 52 | + tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz |
| 53 | + rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz |
| 54 | +
|
| 55 | + - name: Checkout ThunderLibraries |
| 56 | + uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + path: ThunderLibraries |
| 59 | + repository: ${{github.repository_owner}}/ThunderLibraries |
| 60 | + |
| 61 | + - name: Regex ThunderLibraries |
| 62 | + if: contains(github.event.pull_request.body, '[Options:') |
| 63 | + id: libs |
| 64 | + uses: AsasInnab/regex-action@v1 |
| 65 | + with: |
| 66 | + regex_pattern: '(?<=\[Options:).*(?=\])' |
| 67 | + regex_flags: 'gim' |
| 68 | + search_string: ${{github.event.pull_request.body}} |
| 69 | + |
| 70 | + - name: Build ThunderLibraries |
| 71 | + run: | |
| 72 | + cmake -G Ninja -S ThunderLibraries -B ${{matrix.build_type}}/build/ThunderLibraries \ |
| 73 | + -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \ |
| 74 | + -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \ |
| 75 | + -DBROADCAST=ON \ |
| 76 | + ${{steps.libs.outputs.first_match}} |
| 77 | + cmake --build ${{matrix.build_type}}/build/ThunderLibraries --target install |
| 78 | +
|
| 79 | + - name: Tar files |
| 80 | + run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}} |
| 81 | + |
| 82 | + - name: Upload |
| 83 | + uses: actions/upload-artifact@v3 |
| 84 | + with: |
| 85 | + name: ThunderLibraries-${{matrix.build_type}}-artifact |
| 86 | + path: ${{matrix.build_type}}.tar.gz |
0 commit comments