aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/scripts
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2022-08-22 15:05:01 +0200
committerPetr Štetiar <ynezz@true.cz>2022-09-20 12:14:54 +0200
commitf4ca4187cde01a3e412f10657bec0790d3a4cd94 (patch)
tree31d118c9567486fa847aefa64d40973924f606ea /.github/workflows/scripts
parent63ed733d30153667d7d645ab0ee3f5614089c759 (diff)
downloadupstream-f4ca4187cde01a3e412f10657bec0790d3a4cd94.tar.gz
upstream-f4ca4187cde01a3e412f10657bec0790d3a4cd94.tar.bz2
upstream-f4ca4187cde01a3e412f10657bec0790d3a4cd94.zip
ci: show build failures directly in job log output
Instead of waiting for complete workflow finish, then downloading the artifacts, unpacking them and inspecting them, lets try to make the build failure immediately visible in the log output: ====== Make errors from logs/target/linux/compile.txt ====== * Legacy (non-UHI/non-FIT) Boards * Support MIPS SEAD-3 boards (LEGACY_BOARD_SEAD3) [N/y/?] (NEW) Error in reading or end of file. make[6]: *** [scripts/kconfig/Makefile:77: syncconfig] Error 1 make[5]: *** [Makefile:616: syncconfig] Error 2 make[4]: *** [Makefile:736: include/config/auto.conf.cmd] Error 2 make[3]: *** [Makefile:24: build_dir/target-mipsel-openwrt-linux-musl_musl/linux-ramips_mt7620/linux-5.15.62/.modules] Error 2 make[2]: *** [Makefile:11: compile] Error 2 time: target/linux/compile#30.09#11.30#37.92 Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to '.github/workflows/scripts')
-rwxr-xr-x.github/workflows/scripts/show_build_failures.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/.github/workflows/scripts/show_build_failures.sh b/.github/workflows/scripts/show_build_failures.sh
new file mode 100755
index 0000000000..14f699c93d
--- /dev/null
+++ b/.github/workflows/scripts/show_build_failures.sh
@@ -0,0 +1,15 @@
+#!/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"