raiden00pl commented on code in PR #20787:
URL: https://github.com/apache/nuttx/pull/20787#discussion_r4323046796
##########
.github/workflows/arch.yml:
##########
@@ -99,6 +99,113 @@ jobs:
echo 'board_contains_xtensa=1' | tee -a $GITHUB_OUTPUT
fi
+ # Identify ARM Chip Family if PR is isolated to a single family
+ if [[ "$labels" == *"Arch: arm"* || "$labels" == *"Board: arm"* ]];
then
+ num_changed=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json
changedFiles --jq '.changedFiles' 2>/dev/null || echo "0")
+ pr_files=$(gh pr diff $pr --repo $GITHUB_REPOSITORY --name-only
2>/dev/null || gh pr view $pr --repo $GITHUB_REPOSITORY --json files --jq
'.files[].path' 2>/dev/null || echo "")
+ if [[ "$pr_files" != "" ]]; then
+ arm_family=$(echo "$pr_files" | TOTAL_CHANGED="$num_changed" python3
-c '
+ import sys, re, os
+
+ try:
+ total_changed = int(os.environ.get("TOTAL_CHANGED", "0") or "0")
+ except ValueError:
+ sys.exit(0)
+ files = [l.strip() for l in sys.stdin if l.strip()]
+
+ # If file list is incomplete or PR is large (>100 files), leave
arm_family unset
+ if total_changed <= 0 or len(files) < total_changed:
+ sys.exit(0)
+ if total_changed > 100:
+ sys.exit(0)
+
+ code_files = [f for f in files if not
(f.startswith("Documentation/") or f.startswith(".github/") or
f.endswith(".md") or f.endswith(".rst"))]
+ if not code_files:
+ sys.exit(0)
+
+ common_dirs = {"common", "arm", "armv6-m", "armv7-a", "armv7-m",
"armv7-r", "armv8-m", "armv8-r", "cmake", "stm32", "stm32f0l0g0"}
Review Comment:
there is no such thing as `stm32f0l0g0` or `stm32`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]