Menu

1 / 2

pnpm workspaces: the CI cache that survived the fix and cost me 40 minutes per build

DEV Community·Juan Torchia·6 months ago
#cb4OkXjl
#pnpm#typescript#cache#store#build
Reading 0:00
15s threshold

pnpm workspaces: the CI cache that survived the fix and cost me 40 minutes per build

I finished my previous post convinced the monorepo was solid. Tests green, deploy successful, pnpm workspaces configured exactly as the docs say. Went to bed happy.

Next morning I checked the third CI run and saw this in the logs:

Cache not found for input keys: node-modules-cache-abc123 Run pnpm install --frozen-lockfile ... Progress: resolved 847, reused 0, downloaded 847, added 847

Enter fullscreen mode

Exit fullscreen mode

reused 0 . Eight hundred and forty-seven packages downloaded from scratch. Forty minutes of build time where it should've been eight.

My thesis, before I get into the details: pnpm's cache in GitHub Actions does not work out-of-the-box with monorepos . Not because pnpm is broken — pnpm is excellent, I'll say that without ambiguity — but because the store-dir in CI behaves differently than it does locally, and most people never configure it explicitly.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.