ocramz / petsc-hs

Haskell bindings for PETSc and SLEPc
GNU General Public License v3.0
20 stars 4 forks source link

automate test build with Travis #5

Closed ocramz closed 8 years ago

ocramz commented 8 years ago

Currently, testing petsc-hs relies on the user having installed PETSc and the environment variables.

I only commit working installations but I'd like to add a Travis CI build script that checks this for me.

bkaestner commented 8 years ago

Here are some things that probably help to automate builds:

ocramz commented 8 years ago

@bkaestner what do you mean by caching the PETSc installation?

bkaestner commented 8 years ago

Sorry for the late answer. Travis provides a caching mechanism that enables you to keep certain files (for example a fully compiled PETSc suite). Since all Travis containers run on the same underlying machine, it should be possible to cache the PETSc install directory without problems.

That will keep the build times low (except for the first build, that has to download and compile PETSc).

ocramz commented 8 years ago

Thank you; I'm figuring out how to achieve custom Cabal builds using hooks ( #2 ), and once that works I'll focus on CI.

ocramz commented 8 years ago

The referenced Travis build matrix by hvr : https://github.com/hvr/multi-ghc-travis

ocramz commented 8 years ago

It seems like dependency caching on travis-ci is only possible for private repos and the "new" (docker-based, no sudo commands possible).

Without this, the fetching + building time is around 12 minutes. :/

ocramz commented 8 years ago

container-based build as of https://github.com/ocramz/petsc-hs/commit/03af1ca174586f6bda1c5ac09dc93463a097c06e

ocramz commented 8 years ago

.cabal cleaned up, stack-based installation and Travis script up and running ; the build is reproducible, at least on OSX and Linux (see README.md).

However it appears that stack path is not aware of some build directories, so stack exec on the test executable chokes. The problem seems to be when selecting a specific Stackage resolver, rather than leaving it to stack to decide.

/home/travis/build/ocramz/petsc-hs/.stack-work/install/x86_64-linux/lts-3.15/7.10.2/bin /home/travis/build/ocramz/petsc-hs/.stack-work/install/x86_64-linux/lts-3.16/7.10.2/bin /home/travis/build/ocramz/petsc-hs/.stack-work/install/x86_64-linux/nightly-2015-11-30/7.10.2/bin