Skip to content

Commit 104ac5b

Browse files
committed
signal errors in ci_fetch_deps subprocesses
A recent build failed. The original error seemed to be during ci_fetch_deps where a build message said ``` fatal: reference is not a tree: 346c936e14c6ea3a8d3d65cb1fa46202dc92999d fatal: Unable to checkout '346c936e14c6ea3a8d3d65cb1fa46202dc92999d' in submodule path 'extmod/ulab' ``` (along with other problems), but this step didn't signal failure to github actions. By adding the check= parameter, a failure of the subprocess will cause a CalledProcessError to be raised, which will make ci_fetch_deps exit with nonzero status. In turn, this should let Actions understand that something went wrong with this step, instead of waiting for some subsequent step(s) to go wrong.
1 parent f869a86 commit 104ac5b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/ci_fetch_deps.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ def run(title, command):
4747
print("::group::" + title, flush=True)
4848
print(command, flush=True)
4949
start = time.monotonic()
50-
subprocess.run(shlex.split(command), stderr=subprocess.STDOUT)
51-
print("Duration:", time.monotonic() - start, flush=True)
52-
print("::endgroup::", flush=True)
50+
try:
51+
subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=True)
52+
finally:
53+
print("Duration:", time.monotonic() - start, flush=True)
54+
print("::endgroup::", flush=True)
5355

5456

5557
run(

0 commit comments

Comments
 (0)