feat(ci-reports): publish report.tar.gz archive for offline download

Pack HTML report after publish; link archive in run index and CI log.
Add fetch-ci-report.sh helper for agent curl/extract.

[skip ci]
This commit is contained in:
2026-07-28 13:52:26 +03:00
parent 2e81551f84
commit 069b65450f
+20 -1
View File
@@ -92,6 +92,16 @@ rm -rf "${DEST}"
mkdir -p "${DEST}"
cp -a "${SRC}/." "${DEST}/"
create_report_archive() {
local dest="$1"
local archive="${dest}/report.tar.gz"
local tmp
tmp="$(mktemp)"
tar -czf "${tmp}" -C "${dest}" .
mv -f "${tmp}" "${archive}"
}
create_report_archive "${DEST}"
# Convenience: CT puts index under ct_run.*; expose DEST/index.html
if [[ ! -f "${DEST}/index.html" ]]; then
CT_INDEX="$(find "${DEST}" -type f -name index.html 2>/dev/null | head -n 1 || true)"
@@ -123,7 +133,13 @@ INDEX="${REPORTS_DIR}/${REPO}/${RUN_ID}/index.html"
[[ -d "${d}" ]] || continue
name="$(basename "${d}")"
if [[ -f "${d}index.html" ]]; then
echo "<li><a href=\"./${name}/index.html\">${name}</a></li>"
if [[ -f "${d}report.tar.gz" ]]; then
echo "<li><a href=\"./${name}/index.html\">${name}</a> — <a href=\"./${name}/report.tar.gz\">report.tar.gz</a></li>"
else
echo "<li><a href=\"./${name}/index.html\">${name}</a></li>"
fi
elif [[ -f "${d}report.tar.gz" ]]; then
echo "<li><a href=\"./${name}/\">${name}/</a> — <a href=\"./${name}/report.tar.gz\">report.tar.gz</a></li>"
else
echo "<li><a href=\"./${name}/\">${name}/</a></li>"
fi
@@ -132,15 +148,18 @@ INDEX="${REPORTS_DIR}/${REPO}/${RUN_ID}/index.html"
} > "${INDEX}"
URL="${BASE_URL}/${REPO}/${RUN_ID}/${KIND}/"
ARCHIVE_URL="${BASE_URL}/${REPO}/${RUN_ID}/${KIND}/report.tar.gz"
INDEX_URL="${BASE_URL}/${REPO}/${RUN_ID}/"
echo "Report stand: ${STAND}"
echo "Report: ${URL}"
echo "Report archive: ${ARCHIVE_URL}"
echo "Report index: ${INDEX_URL}"
echo "Report path: ${DEST}"
if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
{
echo "### Test report"
echo "- [${KIND}](${URL})"
echo "- [${KIND} archive](${ARCHIVE_URL})"
echo "- [index](${INDEX_URL})"
} >> "${GITHUB_STEP_SUMMARY}"
fi