sudo: false

cache:
  directories:
    - test/elm-stuff/build-artifacts

os:
  - osx
  - linux

env:
  matrix:
    - ELM_VERSION=0.18 TARGET_NODE_VERSION=node
    - ELM_VERSION=0.18 TARGET_NODE_VERSION=4.2

before_install:
  - if [ ${TRAVIS_OS_NAME} == "osx" ];
    then brew update; brew install nvm; mkdir ~/.nvm; export NVM_DIR=~/.nvm; source $(brew --prefix nvm)/nvm.sh;
    fi

install:
  - nvm install $TARGET_NODE_VERSION
  - nvm use $TARGET_NODE_VERSION
  - node --version
  - npm --version
  - npm install -g elm@$ELM_VERSION
  - npm install

script:
  - npm test

sudo: false

cache:
  directories:
    - test/elm-stuff/build-artifacts
    - sysconfcpus

os:
  - osx
  - linux

env:
  matrix:
    - ELM_VERSION=0.18 TARGET_NODE_VERSION=node
    - ELM_VERSION=0.18 TARGET_NODE_VERSION=4.2

before_install:
  - if [ ${TRAVIS_OS_NAME} == "osx" ];
    then brew update; brew install nvm; mkdir ~/.nvm; export NVM_DIR=~/.nvm; source $(brew --prefix nvm)/nvm.sh;
    fi
  - | # epic build time improvement - see https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142
    if [ ! -d sysconfcpus/bin ];
    then
      git clone https://github.com/obmarg/libsysconfcpus.git;
      cd libsysconfcpus;
      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
      make && make install;
      cd ..;
    fi

install:
  - nvm install $TARGET_NODE_VERSION
  - nvm use $TARGET_NODE_VERSION
  - node --version
  - npm --version
  - npm install -g elm@$ELM_VERSION
  - mv $(npm config get prefix)/bin/elm-make $(npm config get prefix)/bin/elm-make-old
  - echo "#\!/bin/bash\\n\\necho \"Running elm-make with sysconfcpus -n 2\"\\n\\n$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old \"\$@\"" > $(npm config get prefix)/bin/elm-make
  - chmod +x $(npm config get prefix)/bin/elm-make
  - npm install

script:
  - npm test

Add sysconfcpus support to Travis
Add sysconfcpus support to Travis
