From 5e569dc0b50741d34ef00763e1d22bd94f96248a Mon Sep 17 00:00:00 2001 From: "v.savkin" Date: Sun, 4 Oct 2026 05:09:02 +0600 Subject: [PATCH] chore: a report index per branch, for the site to find the reports - report.sh writes reports/index.json: every report of the branch with its last run (result, start, tests, coverage, time), newest first - the site reads the reports from raw.githubusercontent.com, which cannot list a folder, so it starts from the index --- .samples/report.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.samples/report.sh b/.samples/report.sh index 5593b4a..c666805 100644 --- a/.samples/report.sh +++ b/.samples/report.sh @@ -6,7 +6,8 @@ # # reports/.json keeps every run of the branch generated from that version (a release tag, or the # template's commit for nightly) and the branch's files; reports/.md is the same for a reader. -# The site reads the JSON. Needs gh with access to the run, its log and its coverage artifact. +# reports/index.json lists the reports with their last run: the site reads it from raw.githubusercontent.com, +# which cannot list a folder. Needs gh with access to the run, its log and its coverage artifact. set -euo pipefail run="$1" @@ -52,4 +53,6 @@ mv "$work/report.json" "$file" echo echo "$(jq '.files | length' "$file") files in the branch; the list is in [$version.json]($version.json)." } > "reports/$version.md" +jq -s 'map(select(.runs | length > 0) | {version, file: "\(.version).json", runs: (.runs | length), last: (.runs[-1] | {conclusion, started, tests, coverage, seconds})}) + | sort_by(.last.started) | reverse' $(ls reports/*.json | grep -v '/index.json$') > reports/index.json echo "$file: $(jq -c '.runs[-1] | {conclusion, tests, coverage, seconds}' "$file")"