I was exploring the CI workflow as part of my university project on GitHub Actions and noticed that the setup-node step doesn't currently include dependency caching.
The current setup-node step looks like this:
Adding cache: 'npm' would allow GitHub Actions to cache node_modules between runs, which can reduce install time on repeated builds:
I tested this on my own Node.js project and it worked without any other changes needed. I appreciate this may already be a considered decision, so happy to hear if there's a reason it's been left out.
I was exploring the CI workflow as part of my university project on GitHub Actions and noticed that the setup-node step doesn't currently include dependency caching.
The current setup-node step looks like this:
with:
node-version: 'lts/*'
Adding cache: 'npm' would allow GitHub Actions to cache node_modules between runs, which can reduce install time on repeated builds:
with:
node-version: 'lts/*'
cache: 'npm'
I tested this on my own Node.js project and it worked without any other changes needed. I appreciate this may already be a considered decision, so happy to hear if there's a reason it's been left out.