<commit_before>language: python
python:
    - "2.7"

sudo: false

addons:
  apt:
    packages:
      - gfortran
      - libcurl4-openssl-dev

services: mongodb
env:
  global:
    - PYTHONPATH=$TRAVIS_BUILD_DIR/girder:~/vtk-precise64/lib/python2.7/site-packages:~/vtk-precise64/lib
    - LD_LIBRARY_PATH=~/vtk-precise64/lib
  matrix:
    - FLOW_BUILD_R=true R_LIBS_USER=~/R
    - FLOW_BUILD_R=false
compiler:
    - gcc

before_install:
    - vmstat 1 1
    - "mongo --eval 'db.runCommand({setParameter: 1, textSearchEnabled: true})' admin"

install:
    - pwd
    - echo $PYTHONPATH

    # Build R from source
    - if ($FLOW_BUILD_R); then
      wget http://cran.rstudio.com/src/base/R-3/R-3.2.0.tar.gz &&
      tar xzf R-3.2.0.tar.gz &&
      cd R-3.2.0 &&
      ./configure --enable-R-shlib &&
      make -j3 &&
      export PATH=$PATH:`pwd`/bin &&
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib:`pwd`/bin &&
      echo $GITHUB_PAT &&
      export GITHUB_PAT=<PASSWORD> &&
      which R Rscript &&
      "[ ! -d ${R_LIBS_USER} ] && mkdir ${R_LIBS_USER}" &&
      R --version &&
      R -e '.libPaths(); sessionInfo()' &&
      Rscript -e 'install.packages(c("ape","geiger","nlme","devtools"), repos=c("http://cran.cnr.Berkeley.edu"))' &&
      R -e 'options(repos="http://cran.cnr.Berkeley.edu");library(devtools);install_github("hafen/cardoonTools")';
      fi;

    - pip install tangelo==0.7.0 pep8 coverage
    - npm install -g grunt grunt-cli

    # Girder
    - cd $TRAVIS_BUILD_DIR
    - git clone https://github.com/girder/girder.git
    - cd girder
    - pip install -r requirements.txt
    - npm install

    # VTK
    - cd $TRAVIS_BUILD_DIR
    - wget http://midas3.kitware.com/midas/download/bitstream/366970/vtk-precise64-118242.tar.gz -O vtk-precise64.tar.gz
    - tar xzf vtk-precise64.tar.gz -C ~

    # Romanesco
    - cd $TRAVIS_BUILD_DIR/girder/plugins
    - git clone https://github.com/Kitware/romanesco.git
    - cd $TRAVIS_BUILD_DIR/girder/plugins/romanesco
    - pip install -r requirements.txt
    - python -m romanesco &

    # TangeloHub
    - cd $TRAVIS_BUILD_DIR
    - npm install

script:
    - mkdir build
    - cd build
    - cmake ..
    - ctest -VV -S ../cmake/travis_continuous.cmake
<commit_msg>Update travis to work with and without R on girder-plugin version of Flow<commit_after>language: python
python:
    - "2.7"

sudo: false

addons:
  apt:
    packages:
      - gfortran
      - libcurl4-openssl-dev

services: mongodb

env:
  global:
    - PYTHONPATH=$TRAVIS_BUILD_DIR/girder:~/vtk-precise64/lib/python2.7/site-packages:~/vtk-precise64/lib
    - LD_LIBRARY_PATH=~/vtk-precise64/lib
  matrix:
    - FLOW_BUILD_R=true R_LIBS_USER=~/R
    - FLOW_BUILD_R=false
compiler:
    - gcc

before_install:
    - vmstat 1 1
    - "mongo --eval 'db.runCommand({setParameter: 1, textSearchEnabled: true})' admin"  # not sure why this is necessary

    # Setup/install Girder
    - cd $HOME
    - git clone https://github.com/girder/girder.git
    - cd girder
    - pip install -r requirements.txt -r requirements-dev.txt
    - npm install

    # Setup/install Romanesco
    - cd $HOME/girder/plugins
    - git clone https://github.com/Kitware/romanesco.git
    - cd $HOME/girder/plugins/romanesco
    - pip install -r requirements.txt
    - pip install -e .

    - echo "$TRAVIS_BUILD_DIR"
    - pwd
    - cp -r $TRAVIS_BUILD_DIR $HOME/girder/plugins
    - ls -al $HOME/girder/plugins
    - ls -al $HOME/girder/plugins/flow

    # Need newer CMake because of external data
    - cd $HOME
    - curl -L "http://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz" | gunzip -c | tar x
    - cd cmake-*/bin && export PATH="${PWD}:${PATH}"
    - cmake --version

install:
    - pwd
    - echo $PYTHONPATH

    # Build R from source
    - if ($FLOW_BUILD_R); then
      wget http://cran.rstudio.com/src/base/R-3/R-3.2.0.tar.gz &&
      tar xzf R-3.2.0.tar.gz &&
      cd R-3.2.0 &&
      ./configure --enable-R-shlib &&
      make -j3 &&
      export PATH=$PATH:`pwd`/bin &&
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib:`pwd`/bin &&
      echo $GITHUB_PAT &&
      export GITHUB_PAT=<PASSWORD> &&
      which R Rscript &&
      "[ ! -d ${R_LIBS_USER} ] && mkdir ${R_LIBS_USER}" &&
      R --version &&
      R -e '.libPaths(); sessionInfo()' &&
      Rscript -e 'install.packages(c("ape","geiger","nlme","devtools"), repos=c("http://cran.cnr.Berkeley.edu"))' &&
      R -e 'options(repos="http://cran.cnr.Berkeley.edu");library(devtools);install_github("hafen/cardoonTools")';
      fi;
    # - npm install -g grunt grunt-cli

    # # VTK
    # - cd $TRAVIS_BUILD_DIR
    # - wget http://midas3.kitware.com/midas/download/bitstream/366970/vtk-precise64-118242.tar.gz -O vtk-precise64.tar.gz
    # - tar xzf vtk-precise64.tar.gz -C ~

    # Rerun npm install because of new plugins
    - cd $HOME/girder
    - npm install

    # Start romanesco
    - python -m romanesco &

script:
  - cd $HOME
  - rm -rf build
  - mkdir build
  - cd build
  - cmake $HOME/girder
  - ctest -V -R flow  # Only run flow test(s) for now

{'fraction_non_alphanumeric': 0.14768015794669298, 'fraction_numerical': 0.01994076999012833, 'mean_word_length': 2.406859448554136, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6024697', 'n_tokens_mistral': 2065, 'n_tokens_neox': 1962, 'n_words': 375}