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 <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18518
This commit is contained in:
Christos Longros authored and GitHub committed 2026-05-11 12:16:48 -07:00
1 parent 45dddc4523
commit 35853ac849
2 files changed
+26

No files matched your search

@@ -6,6 +6,9 @@ Determine the CI type based on the change list and commit message.
Output format: "<type> <source>" 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 @@ FULL_RUN_IGNORE_REGEX = list(map(re.compile, [
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 @@ if __name__ == '__main__':
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')
+4
View File
@@ -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: