From 497cde7dee014b4545fb9ac61edaa2882beb85a6 Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Thu, 6 Jun 2024 09:05:21 +0200 Subject: [PATCH] [Actions] Updating deprecated actions, removing unnecessary checkouts, adding workflow dispatch call (#351) * Make sure that this workflow will be triggered on a test branch * Removing the checkout of Thunder since it should no longer be necessary after last changes * Updating all actions to Node.js 20 * Updating more actions to newest version * Updating Windows actions to newest version * Adding workflow_dispatch to be able to trigger the action manually * Triggering a template from my branch to test it * Adding branch restriction back and using templates from masters * Adding branch restriction back for Windows build --- .../Build ThunderInterfaces on Linux.yml | 1 + .../Build ThunderInterfaces on Windows.yml | 22 +++++++++++-------- .github/workflows/Linux build template.yml | 21 +++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Build ThunderInterfaces on Linux.yml b/.github/workflows/Build ThunderInterfaces on Linux.yml index 225db520..e9bf6142 100644 --- a/.github/workflows/Build ThunderInterfaces on Linux.yml +++ b/.github/workflows/Build ThunderInterfaces on Linux.yml @@ -1,6 +1,7 @@ name: Build ThunderInterfaces on Linux on: + workflow_dispatch: push: branches: ["master"] pull_request: diff --git a/.github/workflows/Build ThunderInterfaces on Windows.yml b/.github/workflows/Build ThunderInterfaces on Windows.yml index 2dd1ea4f..bf1bb076 100644 --- a/.github/workflows/Build ThunderInterfaces on Windows.yml +++ b/.github/workflows/Build ThunderInterfaces on Windows.yml @@ -1,6 +1,7 @@ name: Build ThunderInterfaces on Windows on: + workflow_dispatch: push: branches: ["master"] pull_request: @@ -23,48 +24,50 @@ jobs: name: Build type - ${{matrix.type}}${{matrix.version}} steps: +# ----- Checkout ----- - name: Checkout ThunderOnWindows - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows repository: WebPlatformForEmbedded/ThunderOnWindows - name: Checkout Thunder - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/Thunder repository: ${{github.repository_owner}}/Thunder - name: Checkout ThunderTools - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/ThunderTools repository: ${{github.repository_owner}}/ThunderTools - name: Checkout ThunderClientLibraries - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/ThunderClientLibraries repository: ${{github.repository_owner}}/ThunderClientLibraries - name: Checkout ThunderInterfaces - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/ThunderInterfaces repository: ${{github.repository_owner}}/ThunderInterfaces - name: Checkout ThunderNanoServices - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/ThunderNanoServices repository: ${{github.repository_owner}}/ThunderNanoServices - name: Checkout ThunderNanoServicesRDK - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderOnWindows/ThunderNanoServicesRDK repository: WebPlatformForEmbedded/ThunderNanoServicesRDK +# ----- Building ----- - name: Install jsonref run: pip install jsonref @@ -74,12 +77,13 @@ jobs: cd ThunderOnWindows && "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%definitions%" "%solution%" && "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%interfaces%" "%solution%" - + +# ----- Articats ----- - name: Tar files run: tar -czvf ${{matrix.type}}${{matrix.version}}.tar.gz artifacts - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ThunderInterfaces-${{matrix.type}}${{matrix.version}}-artifact path: ${{matrix.type}}${{matrix.version}}.tar.gz diff --git a/.github/workflows/Linux build template.yml b/.github/workflows/Linux build template.yml index 03687347..f1228a60 100644 --- a/.github/workflows/Linux build template.yml +++ b/.github/workflows/Linux build template.yml @@ -12,10 +12,11 @@ jobs: matrix: build_type: [Debug, Release, MinSizeRel] +# ----- Packages & artifacts ----- name: Build type - ${{matrix.build_type}} steps: - name: Install necessary packages - uses: nick-fields/retry@v2 + uses: nick-fields/retry@v3 with: timeout_minutes: 10 max_attempts: 10 @@ -27,14 +28,8 @@ jobs: 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 + uses: actions/download-artifact@v4 with: name: Thunder-${{matrix.build_type}}-artifact path: ${{matrix.build_type}} @@ -44,10 +39,10 @@ jobs: tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz -# ----- ThunderInterfaces ----- +# ----- Regex & checkout ----- - name: Checkout ThunderInterfaces - default if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderInterfaces repository: rdkcentral/ThunderInterfaces @@ -63,13 +58,13 @@ jobs: - name: Checkout ThunderInterfaces - ${{steps.thunderinterfaces.outputs.first_match}} if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ThunderInterfaces repository: rdkcentral/ThunderInterfaces ref: ${{steps.thunderinterfaces.outputs.first_match}} -# ----- Building ----- +# ----- Building & uploading ----- - name: Build ThunderInterfaces run: | cmake -G Ninja -S ThunderInterfaces -B ${{matrix.build_type}}/build/ThunderInterfaces \ @@ -82,7 +77,7 @@ jobs: run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}} - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ThunderInterfaces-${{matrix.build_type}}-artifact path: ${{matrix.build_type}}.tar.gz