Build a Haskell Project
For Language versions and other build-environment specific information visit our reference pages:
This guide covers configuring Haskell projects on Travis CI. If you’re new to Travis CI. Please read our Onboarding and General Build configuration guides first.
Specify Haskell compiler versions #
The Haskell environment on Travis CI has recent versions of GHC (Glasgow Haskell Compiler) pre-installed. For a detailed list of pre-installed versions, please consult “Build system information” in the build log.
You can specify one or more GHC versions using major.minor
notation. Patch
level versions (7.6.2
for example) may change any time:
Dependency Management #
By default, Travis CI uses cabal
to manage your project’s dependencies:
Specify cabal-install version #
You can specify the version of cabal
used:
Multiple Packages in Subdirectories #
If you have multiple packages in subdirectories (each containing a .cabal
file,
you can specify those directories in an environment variable:
The build matrix is then constructed such that each package is compiled with each version of GHC.
Hackage Deployment #
Travis can automatically upload your package to Hackage. See Hackage Deployment.
Build Config Reference #
You can find more information on the build config format for Haskell in our Travis CI Build Config Reference.
Build with Stack #
Check out Travis CI on Stack if you want to use Stack to build your project.