action: timeout on scripts taking too long
Some scripts might take very long to execute, kill those after 10s and
let the action continue.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/scripts/ci/guideline_check.py b/scripts/ci/guideline_check.py
index b85f5e3..ecc4dc5 100755
--- a/scripts/ci/guideline_check.py
+++ b/scripts/ci/guideline_check.py
@@ -66,13 +66,18 @@
for script in coccinelle_scripts:
script_path = os.getenv("ZEPHYR_BASE") + "/" + script
- cocci = sh.coccicheck(
- "--mode=report",
- "--cocci=" +
- script_path,
- f.path,
- **sh_special_args)
- parse_coccinelle(cocci, violations)
+ print(f"Running {script} on {f.path}")
+ try:
+ cocci = sh.coccicheck(
+ "--mode=report",
+ "--cocci=" +
+ script_path,
+ f.path,
+ _timeout=10,
+ **sh_special_args)
+ parse_coccinelle(cocci, violations)
+ except sh.TimeoutException:
+ print("we timed out waiting, skipping...")
for hunk in f:
for line in hunk: