How do you make CI efficient in a monorepo?
AdvancedProductionMonorepos, large files and repository performance
Answer
Compute the affected set from the dependency graph (Bazel query, Nx affected, Turborepo --filter=...[origin/main]), cache build outputs remotely, run only affected tests on PRs and everything on main or nightly. Use fetch-depth large enough (or git merge-base) to diff against the base.
npx turbo run test --filter="...[origin/main]"
git diff --name-only $(git merge-base origin/main HEAD)
More on Monorepos, large files and repository performance
What are the main trade-offs of a monorepo?IntermediateHow do you onboard developers to a very large repo without a 30-minute clone?IntermediateWhat does Scalar do and when do you recommend it?Advanced`git status` takes 20 seconds in a big working tree. How do you fix it?AdvancedWhen should a team adopt Git LFS and when should it avoid it?IntermediateHow do you control LFS cost and bandwidth in CI?Intermediate