ci(test-quickget): use temp file to collect distro rows for sorting
Replace string concatenation with temp file approach to fix issue where only the first distro appeared in the summary table. Writing rows to a temp file and sorting it directly is more robust than piping concatenated strings through sort.
This commit is contained in:
parent
84c77bd3c3
commit
fed267550d
|
|
@ -113,8 +113,8 @@ jobs:
|
|||
TOTAL_SKIPPED=0
|
||||
HAS_FAILURES=false
|
||||
|
||||
# Build per-distro table rows
|
||||
DISTRO_ROWS=""
|
||||
# Temp file for collecting per-distro table rows
|
||||
TEMP_ROWS=$(mktemp)
|
||||
|
||||
for json_file in results/result-*/result.json; do
|
||||
[ -f "$json_file" ] || continue
|
||||
|
|
@ -139,12 +139,9 @@ jobs:
|
|||
STATUS="✅"
|
||||
fi
|
||||
|
||||
DISTRO_ROWS="${DISTRO_ROWS}$(printf '| %s | %s | %s | %s | %s |\n' "${DISTRO}" "${PASSED}" "${FAILED}" "${SKIPPED}" "${STATUS}")"
|
||||
echo "| ${DISTRO} | ${PASSED} | ${FAILED} | ${SKIPPED} | ${STATUS} |" >> "$TEMP_ROWS"
|
||||
done
|
||||
|
||||
# Sort distro rows alphabetically
|
||||
DISTRO_ROWS_SORTED=$(echo "$DISTRO_ROWS" | sort)
|
||||
|
||||
# Write summary header
|
||||
echo "## Test Results 📊" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
|
@ -160,7 +157,7 @@ jobs:
|
|||
echo "" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "| Distro | Passed | Failed | Skipped | Status |" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "|--------|--------|--------|---------|--------|" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo -n "$DISTRO_ROWS_SORTED" >> "$GITHUB_STEP_SUMMARY"
|
||||
sort "$TEMP_ROWS" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
# Collect and display failed URLs if any
|
||||
if [ "$HAS_FAILURES" = true ]; then
|
||||
|
|
@ -183,6 +180,9 @@ jobs:
|
|||
echo "Total Skipped: ${TOTAL_SKIPPED}"
|
||||
echo "=================="
|
||||
|
||||
# Clean up temp file
|
||||
rm -f "$TEMP_ROWS"
|
||||
|
||||
# Exit with failure if any distro had failures
|
||||
if [ "$HAS_FAILURES" = true ]; then
|
||||
echo "::error::Some distros have failed downloads. Check the summary for details."
|
||||
|
|
|
|||
Loading…
Reference in New Issue