fix: emit the monorepo LHCI workflow at the workspace root - #124
Open
spencer-osbrjp wants to merge 1 commit into
Open
fix: emit the monorepo LHCI workflow at the workspace root#124spencer-osbrjp wants to merge 1 commit into
spencer-osbrjp wants to merge 1 commit into
Conversation
The audit templates were copied into apps/web, so the Lighthouse workflow landed at apps/web/.github/workflows/ where GitHub never runs it. copyDir gains a ghRoot redirect (shared with add's git-root relocation): the audit copy now sends .github/** to the workspace root while lighthouserc.json stays in apps/web. The workflow itself is monorepo-aware — lhci runs with working-directory apps/web, the affected-pages diff uses apps/web-prefixed paths, and a paths filter skips apps/api-only PRs entirely. Closes #115 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #115
What
Monorepo projects scaffolded with
--audit lhcigot their Lighthouse workflow atapps/web/.github/workflows/lhci.yml— a location GitHub silently ignores — with steps that assumed a flat layout even if moved. Now:copyDirgains an explicitghRootparameter that redirects.github/**(unifying the mechanism theaddcommand already used viarep.GitRoot). The audit copy passes the workspace root in monorepo mode, so the workflow lands at.github/workflows/lhci.ymlwhilelighthouserc.jsonstays inapps/web.lhci autorunruns withworking-directory: apps/web(finds the rc file;previewruns in the web app); install/build stay at the root (workspace-recursive).apps/web/src/pages(orapps/web/app/pages) so per-page narrowing keeps working — route mapping strips the prefix.pathsfilter (apps/web/**,packages/**, lockfile) instead ofpaths-ignore, so anapps/api-only PR never spends a single CI minute on Lighthouse — extending the ci(templates): LHCI workflow should audit only the pages a PR affects #113/ci(templates): stop scaffolding a Lighthouse workflow that burns minutes #112 resource work to monorepos.Known remaining gap (same class, different content)
test(playwright) andcicd(deploy) templates still emit.github/**intoapps/webin monorepo mode. Relocating them needs content-aware step changes (their run steps assume the app dir), so they're not silently moved here — happy to take that as a follow-up issue.Testing
go test -count=1 ./...green, including a newlhci_monoreporender case pinning: workflow at the root, no strayapps/web/.github,working-directory: apps/web,apps/web/-prefixedpages_dir, and thepathsfilter. E2E smoke: scaffolded a fullstack monorepo, verified placement and valid YAML.🤖 Generated with Claude Code