Skip to content

Commit

Permalink
fix(ci): prevent issue when no board build
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
fpistm committed Aug 21, 2024
1 parent 53818fa commit 33c65c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,12 @@ def log_sketch_build_result(sketch, boardKo, boardSkipped):
def log_final_result():
# Also equal to len(board_fqbn) * len(sketch_list)
nb_build_total = nb_build_passed + nb_build_failed
stat_passed = round(nb_build_passed * 100.0 / nb_build_total, 2)
stat_failed = round(nb_build_failed * 100.0 / nb_build_total, 2)
if nb_build_total != 0:
stat_passed = round(nb_build_passed * 100.0 / nb_build_total, 2)
stat_failed = round(nb_build_failed * 100.0 / nb_build_total, 2)
else:
stat_passed = 0
stat_failed = 0
duration = str(timedelta(seconds=time.time() - full_buildTime))

# Log file
Expand Down

0 comments on commit 33c65c5

Please sign in to comment.