Skip to content

Speed up `yarn install` in CI by utilizing inter-pipeline cache

Currently yarn install --pure-lockfile is taking about 50s - 100s on every pipeline (in the setup-test-env stage)

Taken from a CI log output:

$ yarn install --pure-lockfile
yarn install v0.23.3
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.17: The platform "linux" is incompatible with this module.
info "fsevents@1.0.17" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 94.30s.

We should be able to speed this up by utilizing a cache for yarn modules.

This should be as simple as editing our .gitlab-ci.yml to include a new cache directory and running yarn with yarn --cache-folder=path/to/cache.