kytrinyx/exercism.io — pull request #776 by etrepum (2013-09-21 01:38:18+00:00)
Title: Test all Haskell exercises with Travis-CI

Here's an example of this working: https://travis-ci.org/etrepum/exercism.io/builds/11617656

Building a copy of Haskell Platform for Ubuntu 12.04 that's small enough to host as a GitHub release, and making it work in Travis' environment, was much harder than I thought it would be. A similar technique could be used to test the exercises from other languages.

The before_script does this:

* Ensures that the relevant deb packages are installed
* Does some dumb stuff to /usr/lib so that the GHC build can find libgmp.so.3
* Downloads a binary of Haskell Platform that I built and untars it to /opt/hp-2013.2.0.0

The check-exercises.hs script does this:

* Creates a temporary directory (that it cleans up on exit)
* Finds all of the Haskell exercises (relative to the current directory)
* For each exercise (serially), figure out what the correct filename for the module should be, copy it to the temporary directory with the right name, and run the test. It collects the name of the exercise if it failed.
* Collect the results, and either print out "SUCCESS!" with exit code 0, or print out "Failures: …" with the list of exercises that failed separated by commas and then fail with exit code 1.