CI: Add FreeBSD 14.2 RELEASE+STABLE builds
[zfs.git] / .github / workflows / scripts / qemu-9-summary-page.sh
blob737dda01b56568b39228f5724d0f8b00630ec055
1 #!/usr/bin/env bash
3 ######################################################################
4 # 9) generate github summary page of all the testings
5 ######################################################################
7 set -eu
9 function output() {
10 echo -e $* >> "out-$logfile.md"
13 function outfile() {
14 cat "$1" >> "out-$logfile.md"
17 function outfile_plain() {
18 output "<pre>"
19 cat "$1" >> "out-$logfile.md"
20 output "</pre>"
23 function send2github() {
24 test -f "$1" || exit 0
25 dd if="$1" bs=1023k count=1 >> $GITHUB_STEP_SUMMARY
28 # https://docs.github.com/en/enterprise-server@3.6/actions/using-workflows/workflow-commands-for-github-actions#step-isolation-and-limits
29 # Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB.
30 # [ ] can not show all error findings here
31 # [x] split files into smaller ones and create additional steps
33 # first call, generate all summaries
34 if [ ! -f out-1.md ]; then
35 logfile="1"
36 for tarfile in Logs-functional-*/qemu-*.tar; do
37 rm -rf vm* *.txt
38 if [ ! -s "$tarfile" ]; then
39 output "\n## Functional Tests: unknown\n"
40 output ":exclamation: Tarfile $tarfile is empty :exclamation:"
41 continue
43 tar xf "$tarfile"
44 test -s env.txt || continue
45 source env.txt
46 # when uname.txt is there, the other files are also ok
47 test -s uname.txt || continue
48 output "\n## Functional Tests: $OSNAME\n"
49 outfile_plain uname.txt
50 outfile_plain summary.txt
51 outfile failed.txt
52 logfile=$((logfile+1))
53 done
54 send2github out-1.md
55 else
56 send2github out-$1.md