language: node_js
node_js:
  - "0.10"
  - "0.8"
env:
  - TEST_COMMAND="grunt shell:test-node"
  - TEST_COMMAND="grunt shell:test-phantomjs"
before_script:
  - "npm install -g grunt-cli"
script:
  $TEST_COMMAND

language: node_js
node_js:
  - "0.10"
  - "0.8"
before_script:
  - "npm install -g grunt-cli"
  # Narwhal uses a hardcoded path to openjdk v6, so use that version
  - "sudo apt-get update -qq"
  - "sudo apt-get install -qq openjdk-6-jre"
  - "PACKAGE=rhino1_7R4; wget https://github.com/downloads/mozilla/rhino/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip"
  - "PACKAGE=rhino1_7R4; echo -e '#!/bin/sh\\njava -jar /opt/rhino1_7R4/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino"
  - "PACKAGE=ringojs-0.9; wget http://ringojs.org/downloads/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip"
  - "PACKAGE=ringojs-0.9; sudo ln -s /opt/$PACKAGE/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo"
  - "PACKAGE=v0.3.2; wget https://github.com/280north/narwhal/archive/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip"
  - "PACKAGE=narwhal-0.3.2; sudo ln -s /opt/$PACKAGE/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal"
  # If the enviroment stores rt.jar in a different directory, find it and symlink the directory
  - "PREFIX=/usr/lib/jvm; if [ ! -d $PREFIX/java-6-openjdk ]; then for d in $PREFIX/java-6-openjdk-*; do if [ -e $d/jre/lib/rt.jar ]; then sudo ln -s $d $PREFIX/java-6-openjdk; break; fi; done; fi"
script:
  "grunt test"

Enable CI tests in Rhino, RingoJS, and Narwhal
Enable CI tests in Rhino, RingoJS, and Narwhal

Thanks to @oxyc for figuring out the appropriate `before_script` rules for this.
