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: