ci: support legacy performance baselines

Issue: #322
User-Visible: no
This commit is contained in:
Matysh
2026-08-27 11:04:38 +03:00
parent 59bf4665f6
commit 6b9f5eea96
2 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -149,7 +149,14 @@ jobs:
npm --prefix candidate run build
(cd candidate && node scripts/bundle-sync.mjs)
npm --prefix baseline run build
(cd baseline && node scripts/bundle-sync.mjs)
if [ -f baseline/scripts/bundle-sync.mjs ]; then
(cd baseline && node scripts/bundle-sync.mjs)
else
echo "::notice::The comparison base predates bundle-sync.mjs; materializing its freshly built bundle with the legacy copy path."
mkdir -p baseline/custom_components/houseplan/frontend baseline/demo/srv/assets
cp baseline/dist/houseplan-card.js baseline/custom_components/houseplan/frontend/houseplan-card.js
cp baseline/dist/houseplan-card.js baseline/demo/srv/assets/houseplan-card.js
fi
- name: Capture base and candidate profiles
working-directory: candidate
+4
View File
@@ -152,6 +152,10 @@ on one pinned Chromium/CI profile, applies relative and absolute budgets, and
uploads both reports plus the comparison. A developer-laptop report remains a
diagnostic and must not be used to loosen CI limits. See
`demo/performance/README.md`.
When the comparison base predates `scripts/bundle-sync.mjs`, the workflow still
builds that exact tree and materializes its fresh bundle through the equivalent
legacy copy path. This keeps old stable releases usable as performance baselines
without borrowing build output from the candidate.
Both browser diagnostics require a freshly built/copied demo bundle. Rollup
embeds a SHA-256 fingerprint of `src/` plus the locked package and
Rollup/TypeScript build inputs; benchmark/golden runners fail before