From 35853ac849d9ba36f8a414cfd9780b1dfb8ee87a Mon Sep 17 00:00:00 2001 From: Christos Longros <98426896+chrislongros@users.noreply.github.com> Date: Mon, 11 May 2026 21:16:48 +0200 Subject: [PATCH] CI: skip qemu matrix for documentation-only pull requests Add a new "docs" CI type, selected when every file modified by a pull request matches a documentation pattern (man pages, .md, AUTHORS, COPYRIGHT, LICENSE, NOTICE, .gitignore). For this type the os_selection is empty and the qemu matrix runs no jobs. This affects only pull requests whose entire diff is documentation. Any change touching a non-documentation file continues to be classified as full, quick, linux, or freebsd by the existing file-path rules, and a manual ZFS-CI-Type commit tag still overrides that classification. Reviewed-by: Brian Behlendorf Signed-off-by: Christos Longros Closes #18518 --- .github/workflows/scripts/generate-ci-type.py | 22 +++++++++++++++++++ .github/workflows/zfs-qemu.yml | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/scripts/generate-ci-type.py b/.github/workflows/scripts/generate-ci-type.py index b1910ab630a..08f0c0fcc9a 100755 --- a/.github/workflows/scripts/generate-ci-type.py +++ b/.github/workflows/scripts/generate-ci-type.py @@ -6,6 +6,9 @@ Output format: " " where source is "manual" (from ZFS-CI-Type commit tag) or "auto" (from file change heuristics). +Prints "docs auto" if every changed file is documentation; the qemu +matrix is skipped in that case. + Prints "quick manual" if: - the *last* commit message contains 'ZFS-CI-Type: quick' or "quick auto" if (heuristics): @@ -28,6 +31,19 @@ r'.*\.gitignore' ])) +""" +Patterns of files that are documentation only. +""" +DOCS_ONLY_REGEX = list(map(re.compile, [ + r'man/.*', + r'.*\.md', + r'AUTHORS', + r'COPYRIGHT', + r'LICENSE', + r'NOTICE', + r'\.gitignore', +])) + """ Patterns of files that are considered to trigger full CI. """ @@ -116,6 +132,12 @@ def output_type(type, source, reason): f'changed file "{f}" matches pattern "{r.pattern}"' ) + if changed_files and all( + any(r.match(f) for r in DOCS_ONLY_REGEX) + for f in changed_files): + output_type('docs', 'auto', + 'all changed files are documentation') + # catch-all output_type('quick', 'auto', 'no changed file matches full CI patterns') diff --git a/.github/workflows/zfs-qemu.yml b/.github/workflows/zfs-qemu.yml index 4b4fd27543f..f07988f701d 100644 --- a/.github/workflows/zfs-qemu.yml +++ b/.github/workflows/zfs-qemu.yml @@ -45,6 +45,9 @@ jobs: fi case "$ci_type" in + docs) + os_selection='[]' + ;; quick) os_selection='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd15-1s", "ubuntu24"]' ;; @@ -91,6 +94,7 @@ jobs: qemu-vm: name: qemu-x86 needs: [ test-config ] + if: needs.test-config.outputs.ci_type != 'docs' strategy: fail-fast: false matrix: