CI: Support repository variable override for ZTS OS selection

Allow restricting ZTS OS targets by setting the vars.ZTS_OS_OVERRIDE
repository variable (e.g. '["debian13"]') to reduce shared runner
contention when running the full OS matrix is unnecessary. When unset,
the existing ci_type-based OS selection is used unchanged.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #18342
This commit is contained in:
Ameer Hamza
2026-03-20 00:21:45 +05:00
committed by Tony Hutter
parent 20b8936c1a
commit 2c861ebcde
2 changed files with 36 additions and 13 deletions
+15 -1
View File
@@ -35,12 +35,13 @@ jobs:
id: os
run: |
ci_type="default"
ci_source="auto"
# determine CI type when running on PR
if ${{ github.event_name == 'pull_request' }}; then
head=${{ github.event.pull_request.head.sha }}
base=${{ github.event.pull_request.base.sha }}
ci_type=$(python3 .github/workflows/scripts/generate-ci-type.py $head $base)
read ci_type ci_source <<< "$(python3 .github/workflows/scripts/generate-ci-type.py $head $base)"
fi
case "$ci_type" in
@@ -59,6 +60,19 @@ jobs:
;;
esac
# Repository-level override for OS selection.
# Set vars.ZTS_OS_OVERRIDE in repo settings to restrict targets
# (e.g. '["debian13"]' or '["debian13", "fedora42"]').
# Manual ZFS-CI-Type in commit messages bypasses the override.
if [ -n "${{ vars.ZTS_OS_OVERRIDE }}" ] && [ "$ci_source" != "manual" ]; then
override='${{ vars.ZTS_OS_OVERRIDE }}'
if echo "$override" | jq -e 'type == "array"' >/dev/null 2>&1; then
os_selection="$override"
else
echo "::warning::Invalid ZTS_OS_OVERRIDE, using default"
fi
fi
if ${{ github.event.inputs.fedora_kernel_ver != '' }}; then
# They specified a custom kernel version for Fedora.
# Use only Fedora runners.