idontgetoutmuch / random

Random number library
Other
3 stars 2 forks source link

Generate .travis.yml via haskell-ci #148

Closed Bodigrim closed 4 years ago

Bodigrim commented 4 years ago

As discussed in https://github.com/haskell/random/pull/62 and elsewhere.

I had to sacrifice coverage shield, mostly because of hpc-coveralls being abandoned, but hopefully this is acceptable.

lehins commented 4 years ago

I don't think stack/no-stack is a binary decision. All we need is one build in a travis matrix that uploads it to coveralls. I think it is a very nice feature to have and it doesn't come at a cost. All we need is this:

  - env: BUILD=stack ARGS="--resolver lts-14.27" STACK_YAML="--stack-yaml stack-old.yaml" COVERALLS_STACK_YAML="stack-coveralls.yaml"
    compiler: ": #stack 8.6.5"
    addons: {apt: {packages: [libgmp-dev]}}

And a conditional in bash. This way we not only get coverage reports, but also validate building with stack.

@Bodigrim thank you for setting it up.

Bodigrim commented 4 years ago

Force-pushed, I've restored coverage reporting.

Bodigrim commented 4 years ago

I tried haskell-ci --doctest, but it does not seem to work without custom setup. https://github.com/Bodigrim/random/tree/haskell-ci-doctest @phadej could you possibly advise?

lehins commented 4 years ago

@Bodigrim Oleg mentioned that splitmix is setup in such a ways that it can run doctests without custom setup. Can't really suggest any more than that, maybe @phadej will shed some light for us.

Bodigrim commented 4 years ago

OK, I managed to work around it. Not in the most elegant way, but it works without custom Setup.hs:

$ if [ $HCNUMVER -ge 80000 ] ; then (cd ${PKGDIR_random} && doctest  src) ; fi
Examples: 100  Tried: 100  Errors: 0  Failures: 0
The command "if [ $HCNUMVER -ge 80000 ] ; then (cd ${PKGDIR_random} && doctest  src) ; fi" exited with 0.

https://travis-ci.com/github/Bodigrim/random/jobs/349955470