Coveralls support for Stack projects
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
src/SHC
test
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
Setup.hs
USAGE.txt
release-bin.py
stack-7.10.yaml
stack-7.8.yaml
stack-hpc-coveralls.cabal
stack.yaml
stylish-haskell.yaml

README.md

Stack HPC Coveralls (SHC)

Tests Code coverage License Version

Coveralls.io integration for Stack-based Haskell projects.


Installing

You can install it with stack install stack-hpc-coveralls, but normally you would use SHC on a continuous integration system such as Travis. In that case, it's best to just download the right precompiled binary in the Releases section on Github, in order to avoid all the compilation hassle.

IMPORTANT NOTICE: SHC needs at least Stack 0.1.7, which at the time of writing is still unreleased and in development.

Running

SHC should work out of the box in any Stack-based project. It may work in other scenarios if you supply the right options, but that's not guaranteed, nor supported. For plain Cabal projects, there is already hpc-coveralls, of which SHC is a spinoff.

Normally, for Stack projects, SHC just needs two things:

  • the name of your package
  • at least one test suite name (you can aggregate the Coverage data of multiple test suites)

Just run the program from the root of you Stack project:

$ shc packagename package-tests

Here is, for example, the Travis configuration for the Argon project:

env:
  - GHCVER=7.8.4 STACK_YAML=stack-7.8.yaml
  - GHCVER=7.10.2 STACK_YAML=stack.yaml

# [...]

script:
  - stack test :argon-test --no-terminal --coverage

after_script:
  - travis_retry curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.3.0/shc-linux-x64-$GHCVER.tar.bz2 | tar -xj
  - ./shc argon argon-test