Problem
Our setupNode action runs a lot and often takes 3-5 minutes, which is pretty slow.
Solution
While the actions/setup-node action caches npm / node itself, it doesn't cache the actual node_modules. This means that we're doing a clean install every time, on slow CI machines, and it takes a while. Instead, let's cache the node_modules directory and only run npm ci if needed.
Problem
Our
setupNodeaction runs a lot and often takes 3-5 minutes, which is pretty slow.Solution
While the
actions/setup-nodeaction caches npm / node itself, it doesn't cache the actual node_modules. This means that we're doing a clean install every time, on slow CI machines, and it takes a while. Instead, let's cache the node_modules directory and only runnpm ciif needed.