I’m seeing the problem with Clojure projects using either Boot or Leiningen, but it is probable that other tools also have the same problem.
As the cache is saved just after dependency step, only files installed during dependency step are cached. Many Boot and Leiningen plugins install more dependencies during run-time and these dependencies are not cached. These dependencies are not declared in a way that they could be downloaded beforehand. Only way to load these dependencies is to run the tests.
E.g. Travis saves the cache at the end of build so all files will be cached.
Is there maybe someway to manually add files to cache after test step?
One example here: https://circleci.com/gh/adzerk-oss/boot-cljs/2
The test step always downloads some dependencies as they are not cached.
Some examples of dependencies which are downloaded only when related task is run:
- boot-http downloads http server when run
- lein-cloverage downloads cloverage library only when run
Also, as both Boot and Lein are relatively slow to start, instead of downloading any dependencies in separate step, I would rather just invoke them once and let it do all the work on single run. Separate dependency step with Lein or Boot adds something like 5 to 15 seconds to build time…
Now that I think, I could probably just set test step as no operation and run tests on dependencies step. Is there any better way?