.github/workflows: Print compilation output and improve annotations

Show the kernel compilation output whenever the run reached the
compilation stage (both pass/fail cases) and add a readable prefix
with the actual filename. Also refactor to use variables for version,
workdir, and output; quote expansions; and switch to titled GitHub
Actions annotations. Drop `-k` and rely on explicit cleanup.
This commit is contained in:
Gleb Chesnokov
2025-10-01 22:11:28 +03:00
parent 59bdb2463c
commit 5245d1cb15
+17 -6
View File
@@ -85,19 +85,30 @@ jobs:
- name: Run regression tests
run: |
err=0
version="${{matrix.version}}"
workdir="/tmp/scst-${version}"
out="output.txt"
./scripts/run-regression-tests -l -q -k -d /tmp/scst-${{matrix.version}} ${{matrix.version}}-nc-ns-nm | tee output.txt
./scripts/run-regression-tests -l -q -d "${workdir}" "${version}-nc-ns-nm" | tee "${out}"
if ! grep -q "Compiling the patched kernel" output.txt; then
echo "::error ::run-regression-tests failed"
if ! grep -q "Compiling the patched kernel" "${out}"; then
echo "::error title=Regression tests::run-regression-tests failed"
err=1
else
if grep -A1 "Compiling the patched kernel" output.txt | grep -E -q "FAILED|[1-9][0-9]* errors"; then
echo "::error ::Regression test failed"
if grep -A1 "Compiling the patched kernel" "${out}" | grep -E -q "FAILED|[1-9][0-9]* errors"; then
echo "::error title=Regression tests::Regression test failed"
err=1
else
echo "::notice title=Regression tests::Succeeded"
fi
f=( "${workdir}"/compilation-*-output.txt )
echo
echo "===== $(basename "${f[0]}") ====="
cat "${f[0]}"
fi
rm -f output.txt
rm -rf "${workdir}"
rm -f "${out}"
exit $err