You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass some parameters from .travis.yml to the script. `build_sketch` will echo the arduino exit code to the log, which is documented at https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#exit-status.
100
+
Pass some parameters from .travis.yml to the script. `build_sketch` will echo the arduino exit status to the log, which is documented at https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#exit-status.
101
101
- Parameter: **sketchPath** - Path to a sketch or folder containing sketches. If a folder is specified it will be recursively searched and all sketches will be verified.
102
102
- Parameter: **boardID** - `package:arch:board[:parameters]` ID of the board to be compiled for. e.g. `arduino:avr:uno`. Board-specific parameters are only supported by Arduino IDE 1.5.5 and newer.
103
103
- Parameter: **allowFail** - `true`, `require`, or `false`. Allow the verification to fail without causing the CI build to fail. `require` will cause the build to fail if the sketch verification doesn't fail.
@@ -126,7 +126,7 @@ Echo a tab separated report of all verification results to the log. The report i
126
126
- Dynamic Memory (bytes) - Dynamic memory usage by global variables in the compiled sketch (not available for some boards).
127
127
-# Warnings - Number of warnings reported by the compiler during the sketch compilation.
128
128
- Allow Failure - Whether the sketch verification was allowed to fail (set by the `allowFail` argument of `build_sketch`).
129
-
- Exit Code - Exit code returned by arduino after the sketch verification.
129
+
- Exit Status - Exit status returned by arduino after the sketch verification.
130
130
-# Board Issues - The number of board issues detected.
131
131
- Board Issue - Short description of the last board issue detected.
# The arduino manpage(https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#exit-status) documents a range of exit codes. These exit codes indicate success, invalid arduino command, or compilation failed due to legitimate code errors. arduino sometimes returns other exit codes that may indicate problems that may go away after a retry.
# The arduino manpage(https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#exit-status) documents a range of exit statuses. These exit statuses indicate success, invalid arduino command, or compilation failed due to legitimate code errors. arduino sometimes returns other exit statuses that may indicate problems that may go away after a retry.
# set -o errexit will cause the script to exit as soon as any command returns a non-zero exit code. Without this the success of the function call is determined by the exit code of the last command in the function
186
+
# set -o errexit will cause the script to exit as soon as any command returns a non-zero exit status. Without this the success of the function call is determined by the exit status of the last command in the function
# Define a dummy value for arduinoExitCode so that the while loop will run at least once
737
-
localarduinoExitCode=255
738
-
# Retry the verification if arduino returns an exit code that indicates there may have been a temporary error not caused by a bug in the sketch or the arduino command
739
-
while [[ $arduinoExitCode-gt$ARDUINO_CI_SCRIPT_HIGHEST_ACCEPTABLE_ARDUINO_EXIT_CODE&&$verifyCount-le$ARDUINO_CI_SCRIPT_SKETCH_VERIFY_RETRIES ]];do
736
+
# Define a dummy value for arduinoExitStatus so that the while loop will run at least once
737
+
localarduinoExitStatus=255
738
+
# Retry the verification if arduino returns an exit status that indicates there may have been a temporary error not caused by a bug in the sketch or the arduino command
739
+
while [[ $arduinoExitStatus-gt$ARDUINO_CI_SCRIPT_HIGHEST_ACCEPTABLE_ARDUINO_EXIT_STATUS&&$verifyCount-le$ARDUINO_CI_SCRIPT_SKETCH_VERIFY_RETRIES ]];do
740
740
# Verify the sketch
741
741
# shellcheck disable=SC2086
742
-
"${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER}/${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER}/arduino"$ARDUINO_CI_SCRIPT_DETERMINED_VERBOSE_BUILD --verify "$absoluteSketchName" --board "$boardID"2>&1| tee "$ARDUINO_CI_SCRIPT_VERIFICATION_OUTPUT_FILENAME";localarduinoExitCode="${PIPESTATUS[0]}"
742
+
"${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER}/${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER}/arduino"$ARDUINO_CI_SCRIPT_DETERMINED_VERBOSE_BUILD --verify "$absoluteSketchName" --board "$boardID"2>&1| tee "$ARDUINO_CI_SCRIPT_VERIFICATION_OUTPUT_FILENAME";localarduinoExitStatus="${PIPESTATUS[0]}"
743
743
local verifyCount=$((verifyCount +1))
744
744
done
745
745
746
-
if [[ "$arduinoExitCode"!="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS" ]];then
746
+
if [[ "$arduinoExitStatus"!="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS" ]];then
747
747
# Sketch build failed
748
748
if [[ "$allowFail"=="true"||"$allowFail"=="require" ]];then
749
749
# Failure is allowed for this test
750
-
local -r buildThisSketchExitCode="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"
750
+
local -r buildThisSketchExitStatus="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"
751
751
else
752
752
# Failure is not allowed for this test, fail the Travis build after completing all sketch builds
753
-
local -r buildThisSketchExitCode="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
753
+
local -r buildThisSketchExitStatus="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
754
754
fi
755
755
else
756
756
# Sketch build succeeded
757
757
if [[ "$allowFail"=="require" ]];then
758
758
# Failure is required for this test, fail the Travis build after completing all sketch builds
759
-
local -r buildThisSketchExitCode="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
759
+
local -r buildThisSketchExitStatus="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
760
760
else
761
761
# Success is allowed
762
-
local -r buildThisSketchExitCode="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"
762
+
local -r buildThisSketchExitStatus="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"
763
763
fi
764
764
765
765
# Parse through the output from the sketch verification to count warnings and determine the compile size
@@ -800,20 +800,20 @@ function build_this_sketch()
800
800
801
801
if [[ "$boardIssue"!=""&&"$ARDUINO_CI_SCRIPT_TEST_BOARD"=="true"&&"$allowFail"!="true" ]];then
802
802
# There was a board issue and board testing is enabled so fail the build
803
-
local -r buildThisSketchExitCode="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
803
+
local -r buildThisSketchExitStatus="$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
# End the folded section of the Travis CI build log
811
811
echo -e "travis_fold:end:build_sketch"
812
812
# Add a useful message to the Travis CI build log
813
813
814
-
echo"arduino exit code: $arduinoExitCode"
814
+
echo"arduino exit status: $arduinoExitStatus"
815
815
816
-
return$buildThisSketchExitCode
816
+
return$buildThisSketchExitStatus
817
817
}
818
818
819
819
@@ -866,17 +866,17 @@ function publish_report_to_repository()
866
866
# Do a pull now in case another job has finished about the same time and pushed a report after the clone happened, which would otherwise cause the push to fail. This is the last chance to pull without having to deal with a merge or rebase.
while [[ "$gitPushExitCode"!="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"&&$pushCount-le$ARDUINO_CI_SCRIPT_REPORT_PUSH_RETRIES ]];do
871
+
while [[ "$gitPushExitStatus"!="$ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS"&&$pushCount-le$ARDUINO_CI_SCRIPT_REPORT_PUSH_RETRIES ]];do
872
872
pushCount=$((pushCount +1))
873
873
# Do a pull now in case another job has finished about the same time and pushed a report since the last pull. This would require a merge or rebase. Rebase should be safe since the commits will be separate files.
0 commit comments