# CI for Haskell

There are a few existing CI solutions for Haskell. I detail some summaries here:

Automatically generates a travis CI configuration. It’s pretty solid, but contains a very large amount of technical debt that has been patched up in the travis config rather than fixed upstream. Philosophically, I dislike it on the principle that if your build tool requires 50+ lines of bash and an autogenerator to be useful in CI, you need a better build tool. But I also recognize that cabal predates damn near every language package manager out there and so suffers the warts of being the trailblazer for many things we take for granted today in a modern project/package manager/build-tool/thingey.

## Packcheck

just a large shell script that attempts to perform a similar role as the janky bash that haskell-ci generates; namely that of automating out the cabal build andand cabal test workflow but in a more robust way.

## General systems

• Gitlab’s CI is pretty solid if you’re using the public gitlab. Your queue times can get really long, though, and the CI isn’t the fastest. I’ve never liked to rely on it for that reason, but for self hosted stuff on an internal company gitlab, it’s very nice.
• Github actions is probably the new goto since it checks so many boxes, has ridiculously generous free usage limits, and integrates really nicely with, well, github’s UI…
• Azure DevOps is the implementation detail of github, and also a pretty solid choice should you want to use it. I find its pipeline syntax a lot more verbose than github actions, but aside from lacking “actions” as a concept, the rest of the conversion is an almost completely straightforward syntactical change. Github Action’s integration w/github is more out of the box, and its third party action ecosystem makes handling things like releases much easier at the cost of (maybe?) making more robust/enterprisey stuff like package version management, “code ownership”, etc., a bit more annoying to deal with.
• AWS’s codebuild is not free, but it’s quite cheap and a solution often used if you’re already using everything else in AWS. It’s… alright. “better than jenkins” is about all I can say it has going for it, but that’s an excruciatingly low bar, all things told

Most other CI setups out there either require tons of integration shenanigans to get them working with github’s UI, flat out don’t support enough features to be super useful for non-trivial codebases, or (mostly) don’t have useful free tiers.

## CI Config Generation

For CI script generation, I kinda feel like those are a bit of an antipattern at times, but recognize their utility. Github action’s templates and “copy+paste” cargo cult READMEs mostly serve the same purpose, but end up having a social pressure on the part of infrastructure builders to continue to make things simpler and easier to use, which I like.

## Haskell Project Codegen (that comes with CI configs)

I’m fond of summoner as being very feature complete as well as pick-your-own-adventure. You can use it to generate anything from just the CI files to a turbo-charged stack+cabal complete configuration.

That said, I’m not 100% happy with the github actions template it spits out. It pins third party actions too tightly, uses v2.4 of cabal by default for whatever reason, and does a few weird things like unconditionally running cabal freeze which a) is best only done on applications, not libraries, and b) completely defeats the purpose of freezing…?

I’ll probably contribute a better template to it at some point because I like the project