From 069b65450fb2b66ed50137eca1ebc87e5803d22e Mon Sep 17 00:00:00 2001 From: Aleksey Sabilin Date: Tue, 28 Jul 2026 13:52:26 +0300 Subject: [PATCH] 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] --- scripts/publish-ci-report.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/publish-ci-report.sh b/scripts/publish-ci-report.sh index 1961859..c718f4f 100644 --- a/scripts/publish-ci-report.sh +++ b/scripts/publish-ci-report.sh @@ -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 "
  • ${name}
  • " + if [[ -f "${d}report.tar.gz" ]]; then + echo "
  • ${name}report.tar.gz
  • " + else + echo "
  • ${name}
  • " + fi + elif [[ -f "${d}report.tar.gz" ]]; then + echo "
  • ${name}/report.tar.gz
  • " else echo "
  • ${name}/
  • " 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