- name: Build tools
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
- run: make tools/install -j$(nproc) BUILD_LOG=1
+ run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Build toolchain
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
- run: make toolchain/install -j$(nproc) BUILD_LOG=1
+ run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Build Kernel
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
- run: make target/compile -j$(nproc) BUILD_LOG=1
+ run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Build Kernel Kmods
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
- run: make package/linux/compile -j$(nproc) BUILD_LOG=1
+ run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Upload logs
if: failure()
--- /dev/null
+#!/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"
- name: Build tools
run: |
cd "$WORKPATH"
- make tools/install -j$(nproc) BUILD_LOG=1
+ make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Move logs to GITHUB_WORKSPACE
if: always()