mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user