For each version of GHC supported, CircleCI will kick off a build that will build and test HIE for that version.
Whenever a new stack-x.y.z is added, be sure to also add it to both the workflow
and jobs
sections of config.yml
.
In addition to the stack based jobs, there is also a job that builds HIE with cabal new-build
.
Currently tests are not run as there is an issue with cabal-helper-wrapper that prevents any ghc-mod tests from passing.
Each job is carried out in a Docker container built from https://github.com/alanz/haskell-dockerfiles/blob/master/haskell-hie-ci/Dockerfile
Since HIE takes a long time to build, CI caches things very liberally.
Most importantly, the ~/.stack-work
directories for HIE as well as every submodule are cached before and after testing (This is so that if the build passes but the tests fail there is still something cached for the next build).
Before restoring any cache, the CircleCI job creates three files and uses their checksum to detect any changes:
all-cabal.txt
detects any changes to.cabal
files (not in submodules or test data)stack-build.txt
detects any changes to thestack-x.y.z
fileresolver.txt
detects any changes to the stack resolver
Each job will tries to restore the most specific cache avaialble for it, and fallback to a more general cache if not available:
- restore_cache:
keys:
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }}
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
If you need to clear the cache on CircleCI, bump the $HIE_CACHE
environment variable via the CircleCI web interface and rerun the workflow.