Skip to content

Commit ecb5a24

Browse files
committed
Add a summary to the report displayed in the log
- Total failed sketch builds - Total warnings - Total board issues
1 parent 985c4e5 commit ecb5a24

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arduino-ci-script.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ readonly ARDUINO_CI_SCRIPT_REPORT_PUSH_RETRIES=10
2828
readonly ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS=0
2929
readonly ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS=1
3030

31+
# Default value
32+
ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT=0
33+
3134

3235
# Create the folder if it doesn't exist
3336
function create_folder()
@@ -820,6 +823,12 @@ function build_this_sketch()
820823
# Add the build data to the report file
821824
echo "$(date -u "+%Y-%m-%d %H:%M:%S")"$'\t'"$TRAVIS_BUILD_NUMBER"$'\t'"$TRAVIS_JOB_NUMBER"$'\t'"https://travis-ci.org/${TRAVIS_REPO_SLUG}/jobs/${TRAVIS_JOB_ID}"$'\t'"$TRAVIS_EVENT_TYPE"$'\t'"$TRAVIS_ALLOW_FAILURE"$'\t'"$TRAVIS_PULL_REQUEST"$'\t'"$TRAVIS_BRANCH"$'\t'"$TRAVIS_COMMIT"$'\t'"$TRAVIS_COMMIT_RANGE"$'\t'"${TRAVIS_COMMIT_MESSAGE%%$'\n'*}"$'\t'"$sketchName"$'\t'"$boardID"$'\t'"$IDEversion"$'\t'"$programStorage"$'\t'"$dynamicMemory"$'\t'"$warningCount"$'\t'"$allowFail"$'\t'"$arduinoExitStatus"$'\t'"$boardIssueCount"$'\t'"$boardIssue"$'\r' >> "$ARDUINO_CI_SCRIPT_REPORT_FILE_PATH"
822825

826+
if [[ "$buildThisSketchExitStatus" != "$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS" ]]; then
827+
ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT=$((ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT + 1))
828+
fi
829+
ARDUINO_CI_SCRIPT_TOTAL_WARNING_COUNT=$((ARDUINO_CI_SCRIPT_TOTAL_WARNING_COUNT + warningCount + 0))
830+
ARDUINO_CI_SCRIPT_TOTAL_BOARD_ISSUE_COUNT=$((ARDUINO_CI_SCRIPT_TOTAL_BOARD_ISSUE_COUNT + boardIssueCount + 0))
831+
823832
# End the folded section of the Travis CI build log
824833
echo -e "travis_fold:end:build_sketch"
825834
# Add a useful message to the Travis CI build log
@@ -839,6 +848,10 @@ function display_report()
839848
echo -e "\n\n\n**************Begin Report**************\n\n\n"
840849
cat "$ARDUINO_CI_SCRIPT_REPORT_FILE_PATH"
841850
echo -e "\n\n"
851+
echo "Total failed sketch builds: $ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT"
852+
echo "Total warnings: $ARDUINO_CI_SCRIPT_TOTAL_WARNING_COUNT"
853+
echo "Total board issues: $ARDUINO_CI_SCRIPT_TOTAL_BOARD_ISSUE_COUNT"
854+
echo -e "\n\n"
842855
else
843856
echo "No report file available for this job"
844857
fi

0 commit comments

Comments
 (0)