Simplileap logo

// Case studies

CI/CD build time cut from 45 minutes to 11

A Next.js monorepo marketplace shaved pipeline duration with Turborepo remote cache, Docker layer reuse, and parallelised Playwright shards.

By Simplileap · Published April 16, 2025 · 9 min read

A B2B marketplace team, Next.js 14 monorepo, three apps, shared UI package, GitHub Actions on self-hosted runners, averaged 45-minute main-branch builds. Engineers skipped CI on hotfixes; release confidence dropped.

Profiling showed: cold npm ci every job (12 min), redundant full TypeScript build across packages (9 min), single-threaded Playwright e2e (18 min), and Docker images rebuilt without layer cache (6 min).

Interventions: Turborepo with Vercel remote cache for shared packages; affected-package detection on pull requests; docker buildx with registry-backed layer cache; Playwright split into four shards with merge-reporter; pnpm instead of npm for install speed.

Problems: initial cache poisoning from a bad turbo artifact, fixed with cache key rotation and main-only publish; self-hosted runners disk exhaustion from dangling images, prune cron added; flaky e2e on payment sandbox timeout, isolated with test clock injection.

Governance: main must stay green; PR required checks under 15 minutes p95; weekly pipeline cost review.

Outcome: main pipeline 45 min → 11 min median; PR checks 38 min → 8 min; deploy frequency 2/week → daily. Team size ~28 engineers, identity not disclosed.

← Back to Case studies

Ready to scope your next initiative?

Share your goals with our Bangalore team. We respond within one business day with a clear path from discovery to delivery.