github / semantic

Parsing, analyzing, and comparing source code across many languages
8.94k stars 453 forks source link

Build dependencies in a recurring Action #682

Open robrix opened 2 years ago

robrix commented 2 years ago

Right now we have an unfortunate problem: we cabal update in CI, then build, often leading to many dependencies being rebuilt. Then we build the branch, but the build or its tests fail, and therefore we don't update the cache with the new dependencies. The next rebuild therefore has to rebuild all the dependencies again, and so on.

@dcreager suggested a lovely idea: cabal update and rebuild the deps in a recurring (perhaps daily, perhaps weekly) Action which then updates our cache. Then the regular CI Action doesn't cabal update or build dependencies; it just fetches the cache and builds the repo & runs tests. CI is then orthogonal to dependency changes and a good time is had by all.

I really adore this idea, the only bit I'm unsure how to do is updating the right cache using cabal-cache; maybe we shouldn't use that with this approach and should instead do what I do in e.g. fresnel's CI Action.