actions-shared-workflows/.github/scripts/show_build_failures.sh
Christian Marangi 8637beb25e
CI: import every relevant workflow from openwrt repository
Import every relevant workflow from openwrt repository.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-06-19 13:17:38 +02:00

16 lines
426 B
Bash

#!/bin/bash
original_exit_code="${ret:-1}"
log_dir_path="${1:-logs}"
context="${2:-10}"
show_make_build_errors() {
grep -slr 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_dir_path" | while IFS= read -r log_file; do
printf "====== Make errors from %s ======\n" "$log_file";
grep -r -C"$context" 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_file" ;
done
}
show_make_build_errors
exit "$original_exit_code"