Skip to content

feat: enhance caching options in Node setup action#188

Merged
kb-typeform merged 4 commits into
mainfrom
PLT-2909-caching-improvements
Feb 11, 2026
Merged

feat: enhance caching options in Node setup action#188
kb-typeform merged 4 commits into
mainfrom
PLT-2909-caching-improvements

Conversation

@kb-typeform

@kb-typeform kb-typeform commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Adds flexible caching strategies to the centralized workflows, allowing teams to optimize CI performance based on their project structure. Tested on Chief with 49% faster CI times (4m 17s → 2m 10s).

🚀 What's New

New Workflow Inputs

Two new optional inputs for frontend-pr-workflow.yml:

cache-mode: 'full' | 'node_modules-only' | 'yarn-cache-only'
  # Default: 'full' (backwards compatible)
  
disable-restore-keys: true | false
  # Default: false (backwards compatible)

Cache Modes Explained

Mode What's Cached Best For Cache Size Install on Hit
full (default) node_modules + ~/.cache/yarn Workspace/monorepos, general use Large Sometimes*
node_modules-only node_modules only Large (>1GB) non-workspace repos Medium Rarely
yarn-cache-only ~/.cache/yarn only Frequent dependency changes Small Always

* Workspace repos always run install to recreate symlinks

📊 Performance Results (Chief)

Before (full mode):

  • Cache size: ~1.25 GB
  • CI time: 4m 17s

After (node_modules-only mode):

  • Cache size: ~440 MB (65% smaller)
  • CI time: 2m 10s (49% faster)
  • Setup time: 2m 17s → 1m 13s (47% faster)

📖 How to Use

For Workspace/Monorepo Projects

uses: Typeform/.github/.github/workflows/frontend-pr-workflow.yml@v1
with:
  app-name: 'my-monorepo'
  # cache-mode: 'full'  # Default, no need to specify

For Large Non-Workspace Projects (like Chief)

uses: Typeform/.github/.github/workflows/frontend-pr-workflow.yml@v1
with:
  app-name: 'my-app'
  cache-mode: 'node_modules-only'  # Faster restore, smaller cache

For Projects with Frequent Dependency Changes

uses: Typeform/.github/.github/workflows/frontend-pr-workflow.yml@v1
with:
  app-name: 'my-app'
  cache-mode: 'yarn-cache-only'  # Smallest cache, fast restore

🔍 How to Choose

Quick decision tree:

  1. Workspace/monorepo? (has "workspaces" in package.json) → Use 'full' (default)
  2. Large cache (>1GB)? → Use 'node_modules-only'
  3. Frequent dependency changes? → Use 'yarn-cache-only'
  4. Not sure? → Use 'full' (default)

See the Cache Strategy Guide for detailed recommendations.

@kb-typeform kb-typeform marked this pull request as ready for review February 11, 2026 14:46
@kb-typeform kb-typeform requested a review from a team as a code owner February 11, 2026 14:46
@kb-typeform kb-typeform merged commit fe2dc4d into main Feb 11, 2026
8 checks passed
@gitstream-cm

gitstream-cm Bot commented Feb 11, 2026

Copy link
Copy Markdown

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

@gitstream-cm

gitstream-cm Bot commented Feb 11, 2026

Copy link
Copy Markdown

🥷 Code experts: no user but you matched threshold 10

kb-typeform has most 👩‍💻 activity in the files.
kb-typeform has most 🧠 knowledge in the files.

See details

.github/workflows/frontend-pr-workflow.yml

Activity based on git-commit:

kb-typeform
FEB 243 additions & 92 deletions
JAN
DEC 458 additions & 16 deletions
NOV
OCT
SEP

Knowledge based on git-blame:
kb-typeform: 100%

shared-actions/setup-node-with-cache/README.md

Activity based on git-commit:

kb-typeform
FEB
JAN 97 additions & 5 deletions
DEC 178 additions & 0 deletions
NOV
OCT
SEP

Knowledge based on git-blame:
kb-typeform: 100%

shared-actions/setup-node-with-cache/action.yml

Activity based on git-commit:

kb-typeform
FEB
JAN 132 additions & 27 deletions
DEC 146 additions & 1 deletions
NOV
OCT
SEP

Knowledge based on git-blame:
kb-typeform: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant