diff --git a/valgrind.bash b/valgrind.bash index 0aedc23..80752e7 100755 --- a/valgrind.bash +++ b/valgrind.bash @@ -56,7 +56,6 @@ parse_valgrind_reports() { kind="warning" fi while IFS= read -r line; do - echo "Parsing line: \"${line}\"" if [[ "${error}" != "" ]]; then if [[ $(echo "${line}" | grep '^==.*== $') && $(skip_criterion_pipe_leaks "${error}") == "1" ]]; then echo "::${kind} title=Valgrind Report '${INPUT_BINARY_PATH}' (${report_id})::${error}" @@ -75,20 +74,21 @@ parse_valgrind_reports() { done done < "${VALGRIND_REPORTS}" rm -f "${VALGRIND_REPORTS}" - [[ "${kind}" == "warning" ]] && exit 0 || exit "${status}" + [[ "${kind}" == "warning" ]] && echo "0" || echo "${status}" } main() { local VALGRIND_REPORTS="valgrind-reports.log" local VALGRIND_FLAGS=$(prepare_valgrind_flags) + local status=0 if [[ "${INPUT_LD_LIBRARY_PATH}" != "" ]]; then export LD_LIBRARY_PATH="${INPUT_LD_LIBRARY_PATH}" fi - echo "Starting Valgrind" valgrind $VALGRIND_FLAGS "${INPUT_BINARY_PATH}" $INPUT_BINARY_ARGS 2>"${VALGRIND_REPORTS}" - echo "Parsing report" - parse_valgrind_reports "${VALGRIND_REPORTS}" + status=$(parse_valgrind_reports "${VALGRIND_REPORTS}") + echo "Exit status: ${status}" + exit "${status}" } main