diff options
| author | Nick Brassel <nick@tzarc.org> | 2023-03-29 15:55:31 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 15:55:31 +1100 |
| commit | 6bdbf77238166e25eb0888c85ad07f0b7dbf16bc (patch) | |
| tree | 56533eb326b78411bf3b56621d5e9feb9f1702dd /util/ci | |
| parent | e2630f9b407fb27fab9b2d3e78849611ecb7bdfb (diff) | |
Add step summary output to CI builds, with failure logs. (#20288)
Diffstat (limited to 'util/ci')
| -rwxr-xr-x | util/ci/generate_failure_markdown.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/util/ci/generate_failure_markdown.sh b/util/ci/generate_failure_markdown.sh new file mode 100755 index 0000000000..5f21f06856 --- /dev/null +++ b/util/ci/generate_failure_markdown.sh | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | set -e | ||
| 4 | |||
| 5 | this_script="$(realpath "${BASH_SOURCE[0]}")" | ||
| 6 | script_dir="$(realpath "$(dirname "$this_script")")" | ||
| 7 | qmk_firmware_dir="$(realpath "$script_dir/../../")" | ||
| 8 | |||
| 9 | dump_failure_info() { | ||
| 10 | local failure_file="$1" | ||
| 11 | local keyboard=$(cat "$failure_file" | grep 'CI Metadata: KEYBOARD=' | cut -d= -f2) | ||
| 12 | local keymap=$(cat "$failure_file" | grep 'CI Metadata: KEYMAP=' | cut -d= -f2) | ||
| 13 | echo "## ${keyboard}:${keymap}" | ||
| 14 | echo "\`\`\`" | ||
| 15 | cat "$failure_file" | sed -e $'s/\x1b\[[0-9;]*m//g' | grep -v "CI Metadata:" | grep -vP "(Entering|Leaving) directory" | ||
| 16 | echo "\`\`\`" | ||
| 17 | } | ||
| 18 | |||
| 19 | for failure_file in $(find "$qmk_firmware_dir/.build" -name 'failed.log.*' | sort); do | ||
| 20 | dump_failure_info "$failure_file" | ||
| 21 | done | ||
