[LTP] [PATCH v2] ci: enable doc testing for new patchwork patches
Andrea Cervesato
andrea.cervesato@suse.de
Fri Apr 25 15:19:42 CEST 2025
From: Andrea Cervesato <andrea.cervesato@suse.com>
Run documentation build in the ci-patchwork-trigger GitHub
workflow when new patchwork patches arrive in the ML.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Changes in v2:
- run multiple workflows by taking an array for workflows to run
- Link to v1: https://lore.kernel.org/r/20250425-ci_enable_sphinx_doc-v1-1-d6e207fd1945@suse.com
---
.github/workflows/ci-patchwork-trigger.yml | 29 +++++++++++++++----------
.github/workflows/ci-sphinx-doc.yml | 35 ++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/ci-patchwork-trigger.yml b/.github/workflows/ci-patchwork-trigger.yml
index 0938aed5ad0df8af8e2e575283b56475ff219ff3..0f4581c1813eb0194226a95a1c3486abb98879ca 100644
--- a/.github/workflows/ci-patchwork-trigger.yml
+++ b/.github/workflows/ci-patchwork-trigger.yml
@@ -43,6 +43,11 @@ jobs:
return;
}
+ const workflows = [
+ 'ci-docker-build.yml',
+ 'ci-sphinx-doc.yml'
+ ];
+
for (const data of lines) {
const [series_id, series_mbox] = data.split('|');
if (series_id.length === 0 || series_mbox.length === 0) {
@@ -50,16 +55,18 @@ jobs:
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,
- }
- });
+ for (const workflow in workflows) {
+ const response = await github.rest.actions.createWorkflowDispatch({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: context.ref,
+ workflow_id: workflow,
+ inputs: {
+ SERIES_ID: series_id,
+ SERIES_MBOX: series_mbox,
+ }
+ });
- console.log(response);
+ console.log(response);
+ }
}
diff --git a/.github/workflows/ci-sphinx-doc.yml b/.github/workflows/ci-sphinx-doc.yml
index e77c766871b98114417dc7d8d1cb108afe885735..61a593d0aad50ed622a92bfa17681e19a6e2608e 100644
--- a/.github/workflows/ci-sphinx-doc.yml
+++ b/.github/workflows/ci-sphinx-doc.yml
@@ -8,6 +8,16 @@ on:
paths: ['doc/**']
pull_request:
paths: ['doc/**']
+ workflow_dispatch:
+ inputs:
+ SERIES_ID:
+ description: LTP patch series ID
+ required: false
+ default: ''
+ SERIES_MBOX:
+ description: LTP patch series URL
+ required: false
+ default: ''
permissions: {}
@@ -25,6 +35,20 @@ jobs:
sudo apt update
sudo apt install autoconf make python3-virtualenv
+ - name: Apply Patchwork series
+ if: inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
+ env:
+ PATCHWORK_TOKEN: ${{ secrets.PATCHWORK_TOKEN }}
+ run: |
+ git config --global user.name 'GitHub CI'
+ git config --global user.email 'github@example.com'
+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
+
+ git checkout -b review_patch_series_"${{ inputs.SERIES_ID }}"
+ curl -k "${{ inputs.SERIES_MBOX }}" | git am
+
+ ./ci/tools/patchwork.sh state "${{ inputs.SERIES_ID }}" "needs-review-ack"
+
- name: Run configure
run: |
cd "$GITHUB_WORKSPACE/ltp/"
@@ -42,3 +66,14 @@ jobs:
cd "$GITHUB_WORKSPACE/ltp/doc/"
. .venv/bin/activate
make
+
+ - name: Send results to Patchwork
+ if: always() && inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
+ env:
+ PATCHWORK_TOKEN: ${{ secrets.PATCHWORK_TOKEN }}
+ run: |
+ ./ci/tools/patchwork.sh check \
+ "${{ inputs.SERIES_ID }}" \
+ "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
+ "${{ matrix.container }}" \
+ "${{ job.status }}"
---
base-commit: 037cb53e353abb571e52b52cbaa6b569ac28c50c
change-id: 20250425-ci_enable_sphinx_doc-3897893080ee
Best regards,
--
Andrea Cervesato <andrea.cervesato@suse.com>
More information about the ltp
mailing list