From fb6d4ae810d8b27791e95c89db545b480bea6238 Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Tue, 4 Aug 2026 10:05:06 -0700 Subject: [PATCH] fix(ci): build website from latest benchmark results The website job generates charts from results/summary.json on main, but scheduled Benchmark runs only publish to the `results` branch: benchmark.yml forces COMMIT_TO_MAIN=false on schedule, so transform-results.yml skips its "Commit to Main Branch" step. main's copy therefore only updates on a manual workflow_dispatch with commit_to_main=true. The last such run was 2025-09-09, so the deployed site has been built from an 11-month-old snapshot. Every framework added since renders with empty charts - currently Astro, and Gea once it has been benchmarked. Sync summary/summary.json from the results branch into the build working tree before generating the site. Nothing is committed, so the existing commit_to_main policy is untouched; the deploy just stops reading a stale snapshot. Falls back to the committed file with a warning annotation when the results branch is not reachable, so forks are unaffected. --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11c9494d..f0706e4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,6 +236,22 @@ jobs: npm ci python scripts/setup/main.py --skip-build + # Scheduled benchmark runs always publish to the `results` branch, but only + # commit to main when manually dispatched with commit_to_main=true. The site + # is built from main, so without this it renders whatever snapshot happened to + # be committed last - omitting every framework added since. + - name: Sync latest benchmark results + run: | + if git fetch --depth=1 origin results 2>/dev/null \ + && git show FETCH_HEAD:summary/summary.json > /tmp/summary.json 2>/dev/null \ + && python -c "import json; json.load(open('/tmp/summary.json'))" 2>/dev/null; then + mv /tmp/summary.json results/summary.json + echo "✅ Synced benchmark results from the results branch" + python -c "import json; d = json.load(open('results/summary.json')); print(' generated:', d.get('metadata', {}).get('generated_at', 'unknown')); print(' frameworks:', ', '.join(sorted(d.get('frameworks', {}))))" + else + echo "::warning::Could not read summary/summary.json from the results branch - building with the committed results/summary.json, which may be out of date" + fi + - name: Build all frameworks and generate website run: | echo "Building all frameworks for comparison website..."