From eabf9c7a4d6596e1301db985f1891491b583eb42 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sun, 11 Aug 2024 20:37:47 +0200 Subject: [PATCH] CI: Refactoring --- .github/workflows/all_platforms.yml | 22 +++++--- .../workflows/{build.yml => build_device.yml} | 1 + .github/workflows/build_platform.yml | 50 +++++++++++++++++++ .github/workflows/sm7125.yml | 48 ++---------------- .github/workflows/sm7325.yml | 48 ++---------------- .github/workflows/sm8150.yml | 48 ++---------------- .github/workflows/sm8250.yml | 48 ++---------------- .github/workflows/sm8350.yml | 48 ++---------------- .github/workflows/sm8550.yml | 48 ++---------------- 9 files changed, 96 insertions(+), 265 deletions(-) rename .github/workflows/{build.yml => build_device.yml} (95%) create mode 100644 .github/workflows/build_platform.yml diff --git a/.github/workflows/all_platforms.yml b/.github/workflows/all_platforms.yml index 6c2c4f13f..6a59010f5 100644 --- a/.github/workflows/all_platforms.yml +++ b/.github/workflows/all_platforms.yml @@ -54,14 +54,22 @@ jobs: run: | echo "value=[$(find ./Platforms -maxdepth 3 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - run: | - echo "${{ steps.matrix.outputs.value }}" - build: - uses: woa-msmnile/msmnilePkg/.github/workflows/build.yml@main - with: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - secrets: inherit + strategy: + matrix: + target: ${{fromJSON(needs.setup.outputs.matrix)}} + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + needs: setup + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: woa-msmnile/msmnilePkg/.github/workflows/build_device.yml@main + with: + target: ${{ matrix.target }} package: strategy: diff --git a/.github/workflows/build.yml b/.github/workflows/build_device.yml similarity index 95% rename from .github/workflows/build.yml rename to .github/workflows/build_device.yml index 7a4d09a7b..002759682 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build_device.yml @@ -15,6 +15,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + # This workflow contains one job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest diff --git a/.github/workflows/build_platform.yml b/.github/workflows/build_platform.yml new file mode 100644 index 000000000..141240c57 --- /dev/null +++ b/.github/workflows/build_platform.yml @@ -0,0 +1,50 @@ +# This is a basic workflow to help you get started with Actions + +name: Build UEFI for a given platform + +on: + workflow_call: + inputs: + platform: + required: true + type: string + +# Indicate that we are running in CI +env: + WM_CI_BUILD: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains two jobs called "setup" and "build" + setup: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + outputs: + matrix: ${{ steps.matrix.outputs.value }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + - id: matrix + run: | + echo "value=[$(find ./Platforms/${{ inputs.platform }} -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT + + build: + strategy: + matrix: + target: ${{fromJSON(needs.setup.outputs.matrix)}} + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + needs: setup + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: woa-msmnile/msmnilePkg/.github/workflows/build_device.yml@main + with: + target: ${{ matrix.target }} diff --git a/.github/workflows/sm7125.yml b/.github/workflows/sm7125.yml index f1b8cd075..c79b424c1 100644 --- a/.github/workflows/sm7125.yml +++ b/.github/workflows/sm7125.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/AtollPkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: AtollPkg + secrets: inherit package: strategy: diff --git a/.github/workflows/sm7325.yml b/.github/workflows/sm7325.yml index 96de24ab3..9d25b2c29 100644 --- a/.github/workflows/sm7325.yml +++ b/.github/workflows/sm7325.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/KodiakPkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: KodiakPkg + secrets: inherit package: strategy: diff --git a/.github/workflows/sm8150.yml b/.github/workflows/sm8150.yml index 72f15df49..b25fe9c25 100644 --- a/.github/workflows/sm8150.yml +++ b/.github/workflows/sm8150.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/SurfaceDuo1Pkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: SurfaceDuo1Pkg + secrets: inherit package: strategy: diff --git a/.github/workflows/sm8250.yml b/.github/workflows/sm8250.yml index 7329319ff..5fb833a8e 100644 --- a/.github/workflows/sm8250.yml +++ b/.github/workflows/sm8250.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/KonaPkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: KonaPkg + secrets: inherit package: strategy: diff --git a/.github/workflows/sm8350.yml b/.github/workflows/sm8350.yml index 154baa634..b0936bc91 100644 --- a/.github/workflows/sm8350.yml +++ b/.github/workflows/sm8350.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/SurfaceDuo2Pkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: SurfaceDuo2Pkg + secrets: inherit package: strategy: diff --git a/.github/workflows/sm8550.yml b/.github/workflows/sm8550.yml index 29a6576dc..c083279c4 100644 --- a/.github/workflows/sm8550.yml +++ b/.github/workflows/sm8550.yml @@ -13,50 +13,12 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains three jobs called "setup" "build" and "package" - setup: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.matrix.outputs.value }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - id: matrix - run: | - echo "value=[$(find ./Platforms/KailuaPkg -maxdepth 2 -wholename "*/Device/*" -printf "\"%f\", ")]" >> $GITHUB_OUTPUT - - - run: | - echo "${{ steps.matrix.outputs.value }}" - + # This workflow contains two jobs called "build" and "package" build: - strategy: - matrix: - target: ${{fromJSON(needs.setup.outputs.matrix)}} - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - needs: setup - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Build SecureBoot and No SecureBoot UEFI for ${{ matrix.target }} - run: bash scripts/ci_setup.sh && ./build_uefi.py -d ${{ matrix.target }} - - - name: Upload ${{ matrix.target }}'s Artifact - uses: actions/upload-artifact@v4 - with: - name: uefi-images-${{ matrix.target }} - path: Build/*/ci_artifacts - compression-level: 9 + uses: woa-msmnile/msmnilePkg/.github/workflows/build_platform.yml@main + with: + platform: KailuaPkg + secrets: inherit package: strategy: