ci: add lightweight validation fast path
This commit is contained in:
@@ -55,6 +55,33 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# MANAGED_FAST_PATH: documentation and this baseline workflow cannot
|
||||
# affect the shipped runtime. Keep the required status check, but do
|
||||
# not install toolchains or execute the full product suite.
|
||||
if [[ -n "${GITHUB_BASE_REF:-}" ]]; then
|
||||
git fetch --no-tags --depth=1 origin "${GITHUB_BASE_REF}"
|
||||
managed_base="origin/${GITHUB_BASE_REF}"
|
||||
git diff --check "${managed_base}..HEAD"
|
||||
mapfile -t managed_changed_files < <(
|
||||
git diff --name-only --diff-filter=ACMR "${managed_base}..HEAD"
|
||||
)
|
||||
managed_runtime_change=0
|
||||
for managed_path in "${managed_changed_files[@]}"; do
|
||||
case "${managed_path}" in
|
||||
*.md|*.mdx|docs/*|.github/ISSUE_TEMPLATE/*|.gitea/ISSUE_TEMPLATE/*|.gitea/runner-scope.sh|.gitea/workflows/managed-validation.yml)
|
||||
;;
|
||||
*)
|
||||
managed_runtime_change=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [[ "${#managed_changed_files[@]}" -gt 0 && "${managed_runtime_change}" -eq 0 ]]; then
|
||||
printf 'Managed validation fast path: %s non-runtime file(s); full product suite skipped.\n' \
|
||||
"${#managed_changed_files[@]}"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
if [[ -f pyproject.toml || -f requirements.txt ]]; then
|
||||
# Compile only tracked Python sources. Running compileall after a
|
||||
# Node install would otherwise traverse node_modules and turn a
|
||||
|
||||
Reference in New Issue
Block a user