All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6 3/4] ci: add ci-patchwork-trigger workflow
Date: Tue, 15 Apr 2025 17:12:56 +0200	[thread overview]
Message-ID: <Z_53eNAcp0piNyuO@yuki.lan> (raw)
In-Reply-To: <20250415-patchwork_ci-v6-3-81e6d4184af5@suse.com>

Hi!
> Add ci-patchwork-trigger workflow that is meant to run every 30 minutes,
> checking for new untested LTP patches in the Mailing List and running
> the ci-docker-build workflow on them.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  .github/workflows/ci-patchwork-trigger.yml | 65 ++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
> 
> diff --git a/.github/workflows/ci-patchwork-trigger.yml b/.github/workflows/ci-patchwork-trigger.yml
> new file mode 100644
> index 0000000000000000000000000000000000000000..0938aed5ad0df8af8e2e575283b56475ff219ff3
> --- /dev/null
> +++ b/.github/workflows/ci-patchwork-trigger.yml
> @@ -0,0 +1,65 @@
> +# Copyright (c) 2025 Andrea Cervesato <andrea.cervesato@suse.com>
> +
> +name: "Patchwork checker"
> +on:
> +  push:

Does it make sense to run the script both on schedulle and push?

> +  schedule:
> +    - cron: '*/15 * * * 1-5'
> +    - cron: '*/45 * * * 6,0'

So we run this less on weekends, I suppose that may make some sense.

> +env:
> +  PATCHWORK_CI_FILE: patchwork-ci-output.txt
> 
> +jobs:
> +  checker:
> +    if: ${{ github.repository == 'linux-test-project/ltp' }}
> +    runs-on: ubuntu-latest
> +    steps:
> +      - name: Git checkout
> +        uses: actions/checkout@v1
> +
> +      - name: Verify new patches
> +        id: verify
> +        run: |
> +          ./ci/tools/patchwork.sh verify > "$PATCHWORK_CI_FILE"
> +          cat "$PATCHWORK_CI_FILE"
> +
> +      - name: Run tests
> +        if: success()
> +        uses: actions/github-script@v7
> +        with:
> +          script: |
> +            const fs = require('fs');
> +
> +            const output = fs.readFileSync(process.env.PATCHWORK_CI_FILE, 'utf8');
> +            if (output.length === 0) {
> +              console.log("'patchwork-ci.sh verify' output is empty");
> +              return;
> +            }
> +
> +            const lines = output.split('\n');
> +            if (lines.length === 0) {
> +              console.log("No new patch-series found");
> +              return;
> +            }
> +
> +            for (const data of lines) {
> +              const [series_id, series_mbox] = data.split('|');
> +              if (series_id.length === 0 || series_mbox.length === 0) {
> +                console.log(`Malformed data: ${data}`);
> +                continue;
> +              }
> +
> +              const response = await github.rest.actions.createWorkflowDispatch({
> +                owner: context.repo.owner,
> +                repo: context.repo.repo,
> +                ref: context.ref,
> +                workflow_id: 'ci-docker-build.yml',
> +                inputs: {
> +                  SERIES_ID: series_id,
> +                  SERIES_MBOX: series_mbox,
> +                }
> +              });
> +
> +              console.log(response);
> +            }

The code looks sane to me, though I'm not expert on github CI.

You can add my:

Acked-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2025-04-15 15:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 10:00 [LTP] [PATCH v6 0/4] Support for Patchwork CI Andrea Cervesato
2025-04-15 10:00 ` [LTP] [PATCH v6 1/4] ci: install dependences for patchwork-ci script Andrea Cervesato
2025-04-15 14:45   ` Cyril Hrubis
2025-04-15 10:00 ` [LTP] [PATCH v6 2/4] ci: add patchwork communication script Andrea Cervesato
2025-04-15 13:48   ` pvorel
2025-04-15 15:36   ` Cyril Hrubis
2025-04-15 10:00 ` [LTP] [PATCH v6 3/4] ci: add ci-patchwork-trigger workflow Andrea Cervesato
2025-04-15 13:53   ` pvorel
2025-04-15 15:12   ` Cyril Hrubis [this message]
2025-04-15 16:10     ` Andrea Cervesato via ltp
2025-04-15 10:00 ` [LTP] [PATCH v6 4/4] ci: apply patchwork series in ci-docker-build workflow Andrea Cervesato
2025-04-15 13:55   ` pvorel
2025-04-15 16:34   ` Cyril Hrubis
2025-04-15 16:37     ` Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_53eNAcp0piNyuO@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.