ci(build): track build performance with Next.js cache + metrics#7
Merged
Conversation
Add a CI build job that restores the Next.js incremental cache (.next/cache) keyed on lockfile + source hash, then runs pnpm build:metrics. The new scripts/build-metrics.mjs times the production build, writes reports/build-metrics.json, appends a job summary, and uploads it as an artifact so build-duration regressions are visible across runs. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @factory-sam's task —— View job Good addition overall: CI now builds with incremental caching and exports build timing as an artifact. Two follow-ups: handle spawn() failures in build-metrics, and align AGENTS.md with the actual JSON field name. |
Address code-review findings on PR #7: - Add a child 'error' handler (with a settle guard) so a failed pnpm spawn still resolves and forwards a non-zero exit code instead of crashing. - AGENTS.md referenced a 'cache-hit' field; the report writes cacheRestored. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Droid finished @factory-sam's task —— View job LGTM, the CI build-performance tracking changes look correct and I did not find any high-confidence actionable issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds deliberate build performance tracking to CI, which previously never built the app and had no build caching or timing.
Changes
.github/workflows/code-quality.yml- newbuildjob that:.next/cache) viaactions/cache, keyed on the lockfile + source hash with arestore-keysfallback, so rebuilds reuse compiler work instead of always building cold.pnpm build:metricswith public, non-secret placeholder Supabase env (deterministic build, no secret dependency).reports/build-metrics.jsonas abuild-metricsartifact and passes the cache-hit through to the script.scripts/build-metrics.mjs(new) - times the production build (wall-clock), writes a machine-readable report (duration, cache-hit, Next/Node versions, commit, timestamp), appends a summary to the GitHub job page, and forwards the build exit code.package.json- adds thebuild:metricsscript.AGENTS.md- documents the command and the CI build-performance practice.Why
Satisfies the agent-readiness
build_performance_trackingsignal with real value: CI now actually builds the app (catching build breakage), uses incremental build caching, and tracks/exports build duration so regressions are visible over time.Verified locally:
pnpm build:metricsbuilds successfully and emits valid metrics JSON;pnpm lintandpnpm validate-docspass.