Joey's Computing Blog

Languages, Theory and other Fun Stuff

Elm binaries for Travis-CI


Elm is now distrubuted via NPM. You can now easily load it on TravisCI with a .travis.yml that looks like this:

language: node_js
  - "node"

  - "npm install elm@VERSION"

script: elm make --yes

where you replace VERSION with the version of Elm you’d like to test with.

Elm on TravisCI

If you’ve ever used cabal on Travis-CI, you know that it’s painfully slow, sometimes taking up to fifteen minutes to compile and install your dependencies for a Haskell package.

The thing is, you shouldn’t even need Haskell dependencies if you’re just trying to compile Elm programs. To help speed this up, I’ve made Elm binaries built on Travis-CI and hosted on my Github Pages site.

To use them, just add wget to your .travis.yml file to download them, then call them like normal binaries. You can replace NAME_OF_BINARY with any one of elm, elm-get, elm-doc, elm-repl or elm-server. There’s also elm_home.tar.gz which contains the runtime and some other required files.

Alternately, you can download the files here:

Here’s an example .travis.yml file making use of these:

  - ELM_HOME="./elm-home"
- wget
- wget
- wget
- chmod +x ./elm
- chmod +x ./elm-get
- tar -xzf elm_home.tar.gz ./
- ./elm-get install johnpmayer/elm-linear-algebra
- ./elm-get install johnpmayer/elm-webgl
- cd build
- git checkout gh-pages
- git pull
- cd ..
script: ./elm --make --set-runtime="" ObjTest.elm
- cd build
#Do stuff with whatever you build

If there’s ever a problem, or they’re out of date, just submit a Pull Request on the README file on GitHub, and the binaries will be re-generated when I accept it.

Current build status: Foo