[LTP] [PATCH 4/4] ci: apply patchwork series in ci-docker-build workflow

Ricardo B. Marlière rbm@suse.com
Thu Apr 10 20:11:57 CEST 2025


Hi Andrea!

On Thu Apr 10, 2025 at 12:29 PM -03, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
>
> Modify ci-docker-build workflow in order to apply untested new
> patchwork patch-series inside the current branch and to send back
> results in the patchwork instance.
>
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  .github/workflows/ci-docker-build.yml | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml
> index 44dcca055018a1fb06541a788e3152239aea2e66..21a9ba0bf6af3fdf77f15258d761da0ab311ce16 100644
> --- a/.github/workflows/ci-docker-build.yml
> +++ b/.github/workflows/ci-docker-build.yml
> @@ -1,7 +1,19 @@
>  # Copyright (c) 2021-2024 Petr Vorel <pvorel@suse.cz>
>  
>  name: "Test building in various distros in Docker"
> -on: [push, pull_request]
> +on:
> +  push:
> +  pull_request:
> +  workflow_dispatch:
> +    inputs:
> +      SERIES_ID:
> +        description: LTP patch series ID
> +        required: false
> +        default: ''
> +      SERIES_MBOX:
> +        description: LTP patch series URL
> +        required: false
> +        default: ''
>  
>  permissions:
>    contents: read # to fetch code (actions/checkout)
> @@ -125,6 +137,10 @@ jobs:
>      - name: Compiler version
>        run: $CC --version
>  
> +    - name: Apply Patchwork series
> +      if: inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
> +      run: ./ci/patchwork-ci.sh apply ${{ inputs.SERIES_ID }} ${{ inputs.SERIES_MBOX }}
> +

That `if:` condition will disable this job to be run when we push to a
fork, right?

>      - name: ver_linux
>        run: ./ver_linux
>  
> @@ -158,3 +174,14 @@ jobs:
>        run: |
>          if [ "$MAKE_INSTALL" = 1 ]; then INSTALL_OPT="-i"; fi
>          ./build.sh -r install -o ${TREE:-in} $INSTALL_OPT
> +
> +    - name: Send results to Patchwork
> +      if: always() && inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
> +      env:
> +        PATCHWORK_TOKEN: ${{ secrets.PATCHWORK_TOKEN }}

Even with the `if:`, I think it would be better to check if
$PATCHWORK_TOKEN is null in patchwork-ci.sh

> +      run: |
> +        ./ci/patchwork-ci.sh check \
> +          "${{ inputs.SERIES_ID }}" \
> +          "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
> +          "${{ matrix.container }}" \
> +          "${{ job.status }}"

Nice work!

Thank you,
-	rbm




More information about the ltp mailing list