language: scala
scala:
  - 2.11
sudo: false

cache:
  directories:
    $HOME/.ivy2
    $INSTALL_DIR

git:
  depth: 10

sbt_args: -Dsbt.log.noformat=true

env:
  global:
    INSTALL_DIR=$TRAVIS_BUILD_DIR/install
    VERILATOR_ROOT=$INSTALL_DIR
    PATH=$PATH:$VERILATOR_ROOT/bin:$TRAVIS_BUILD_DIR/utils/bin

install:
  # Grab Chisel 3
  - git clone https://github.com/ucb-bar/chisel3.git
  # Install Verilator (if not found in cache)
  - bash .install_verilator.sh

script:
  # FIRRTL Tests
  - verilator --version
  - cd $TRAVIS_BUILD_DIR
  - sbt clean test
  - make clean build-scala regress
  # Chisel 3 Tests
  - cd chisel3
  - sbt clean test
