Skip to content

Commit 33c65c5

Browse files
committed
fix(ci): prevent issue when no board build
If only one board requested but skipped by the config there is no build in that case avoid zero division. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 53818fa commit 33c65c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: CI/build/arduino-cli.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,12 @@ def log_sketch_build_result(sketch, boardKo, boardSkipped):
675675
def log_final_result():
676676
# Also equal to len(board_fqbn) * len(sketch_list)
677677
nb_build_total = nb_build_passed + nb_build_failed
678-
stat_passed = round(nb_build_passed * 100.0 / nb_build_total, 2)
679-
stat_failed = round(nb_build_failed * 100.0 / nb_build_total, 2)
678+
if nb_build_total != 0:
679+
stat_passed = round(nb_build_passed * 100.0 / nb_build_total, 2)
680+
stat_failed = round(nb_build_failed * 100.0 / nb_build_total, 2)
681+
else:
682+
stat_passed = 0
683+
stat_failed = 0
680684
duration = str(timedelta(seconds=time.time() - full_buildTime))
681685

682686
# Log file

0 commit comments

Comments
 (0)