hpc-coveralls
hpc-coveralls copied to clipboard
Add stack support
resolve #47
- Test project: https://github.com/mizunashi-mana/test-hpc-coveralls
- Travis result: https://travis-ci.org/mizunashi-mana/test-hpc-coveralls
- Coveralls: https://coveralls.io/github/mizunashi-mana/test-hpc-coveralls
Notice
- Not support multiple stack package
Someone created a pull request to add a similar feature to codecov-haskell: guillaume-nargeot/codecov-haskell/pull/12 That change seems simpler, but I can't judge yet whether it provides the same flexibility as your change...
@guillaume-nargeot OK, I modified my changes to refer to guillaume-nargeot/codecov-haskell#12
My changes provide below searching flows:
- If
use-stack-cov
enabled, only using stack coverage reports - Both
tix-dir
/mix-dir
provided, use this directories - Other case:
- Searching default coverage reports (
dist/hpc
/dist/hpc/vanilla
) - Searching stack coverage reports (
stack path --local-hpc-dir
)
- Searching default coverage reports (
- If not found hpc directories, failed and show error messages
And, to detect stack:
- Run
stack --version
, then if DoesNotExistError raised, failed to use stack - Detect a stack project to use
stack path --project-root
, then if this is not a stack project, failed to use stack
Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.
Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.
Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.
Can you merge this? I am currently trying to move the hpc generated by stack into cabal's place, but it is failing horribly. Or just some pointer toward what I am doing wrong will help, thx https://travis-ci.org/ThoughtWorksInc/DeepDarkFantasy#L779
@MarisaKirisame While we wait on it being merged, I just built it in a fork:
Install binary (I did it once in my Docker image):
wget -qO- https://github.com/jBugman/hpc-coveralls/releases/download/stack/coveralls.tar.gz | \
tar xvz -C {DIR_IN_A_PATH}
Upload report:
timeout 10
hpc-coveralls {TEST_SUITE_NAME}
--tix-dir=$(stack path --local-hpc-root)/{LIBRARY_NAME}
--mix-dir=$(stack path --dist-dir)/hpc
--repo-token=$COVERALLS_TOKEN
|| true
Timeout is there because it just hangs after a successful upload for a more than a minute for some reason.
Thx, I had already used stack-hpc-coveralls, it is working well. @jBugman