language: python

env: 
  global: 
    - EPANET_HOME=`pwd`
    - BUILD_HOME=buildprod
    - TEST_HOME=tests/epanet-nrtestsuite

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install -y libboost-test-dev
  - sudo apt-get install -y swig 

#install:

before_script:
  - mkdir -p $BUILD_HOME
  - cd $BUILD_HOME
  - cmake ..

script:
  - cmake --build . 
  # run unit tests
  - cd tests
  - ctest
  # run regression tests
  - cd $EPANET_HOME
  - pip install -r tools/requirements.txt
  - tools/app-config.sh $EPANET_HOME/$BUILD_HOME/bin > $TEST_HOME/apps/epanet-$TRAVIS_COMMIT.json
  - tools/run-nrtest.sh $TEST_HOME $TRAVIS_COMMIT
