<commit_before>sudo: false
matrix:
  include:
    - language: python
      python: '3.6'
      services:
        - mongodb
      addons:
        apt:
          sources:
          - mongodb-upstart
          - mongodb-3.4-precise
          packages:
          - libtbb-dev
          - libffi6
          - libffi-dev
          - mongodb-org-server
          - mongodb-org-shell
      cache:
        pip: true
        apt: true
        directories:
        - client/node_modules
      env:
      - TRAVIS_NODE_VERSION="6"
      before_install:
      - pip install codacy-coverage
      - wget http://eddylab.org/software/hmmer3/3.1b2/hmmer-3.1b2-linux-intel-x86_64.tar.gz
      - tar -xf hmmer-3.1b2-linux-intel-x86_64.tar.gz
      - export PATH=${PATH}:${PWD}/hmmer-3.1b2-linux-intel-x86_64/binaries
      - wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip
      - unzip bowtie2-2.3.2-legacy-linux-x86_64.zip
      - export PATH=${PATH}:${PWD}/bowtie2-2.3.2-legacy
      - bowtie2 --version
      - wget https://github.com/relipmoc/skewer/archive/0.2.2.tar.gz
      - tar -xvf 0.2.2.tar.gz
      - cd skewer-0.2.2
      - make
      - cd ..
      - export PATH=${PATH}:${PWD}/skewer-0.2.2
      - skewer --version
      - wget https://github.com/ablab/spades/releases/download/v3.11.0/SPAdes-3.11.0-Linux.tar.gz
      - tar -xvf SPAdes-3.11.0-Linux.tar.gz
      - export PATH=${PATH}:${PWD}/SPAdes-3.11.0-Linux/bin
      - spades.py --version
      install:
      - pip install -r requirements.txt
      - rm -rf ~/.nvm
      - git clone https://github.com/creationix/nvm.git ~/.nvm
      - cd ~/.nvm
      - git checkout `git describe --abbrev=0 --tags`
      - source ~/.nvm/nvm.sh
      - nvm install $TRAVIS_NODE_VERSION
      - npm install -g yarn
      - npm install -g webpack@v3.11.0
      - cd $TRAVIS_BUILD_DIR
      - cd client
      - yarn install
      - webpack --config webpack.production.config.babel.js
      - cd $TRAVIS_BUILD_DIR
      before_script:
      - sleep 15
      script:
      - pytest --loop uvloop --cov --cov-report xml
      - mkdir gh_build
      - mkdir gh_build/virtool
      - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
      - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); print(flags&os.O_NONBLOCK);'
      - python setup.py build
      - ls -lh build/exe.linux-x86_64-3.6
      - cp -rv build/exe.linux-x86_64-3.6/* gh_build/virtool
      - cp -rv assets gh_build/virtool
      - cp -rv templates gh_build/virtool
      - cp -rv client/dist gh_build/virtool/client
      - cp -v LICENSE gh_build/virtool
      - cp -v readme.md gh_build/virtool
      - echo $TRAVIS_TAG > gh_build/virtool/VERSION
      - cd gh_build
      - tar -cvzf virtool.tar.gz virtool
      - tar -tvf virtool.tar.gz
      - cd ..
      after_script:
      - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then python-codacy-coverage -r coverage.xml;
        fi
      deploy:
        - provider: releases
          skip_cleanup: true
          api_key:
            secure: <KEY>
          file: gh_build/virtool.tar.gz
          on:
            tags: true

        - provider: releases
          skip_cleanup: true
          api_key:
            secure: <KEY>
          file: gh_build/virtool.tar.gz
          draft: true

    - language: node_js
      node_js:
      - 'stable'
      cache:
        yarn: true
        directories:
        - client/node_modules
      before_script:
      - cd $TRAVIS_BUILD_DIR
      - cd client
      - yarn install
      script:
      - yarn test --maxWorkers=4<commit_msg>Set explicit node version<commit_after>sudo: false
matrix:
  include:
    - language: python
      python: '3.6'
      services:
        - mongodb
      addons:
        apt:
          sources:
          - mongodb-upstart
          - mongodb-3.4-precise
          packages:
          - libtbb-dev
          - libffi6
          - libffi-dev
          - mongodb-org-server
          - mongodb-org-shell
      cache:
        pip: true
        apt: true
        directories:
        - client/node_modules
      env:
      - TRAVIS_NODE_VERSION="6"
      before_install:
      - pip install codacy-coverage
      - wget http://eddylab.org/software/hmmer3/3.1b2/hmmer-3.1b2-linux-intel-x86_64.tar.gz
      - tar -xf hmmer-3.1b2-linux-intel-x86_64.tar.gz
      - export PATH=${PATH}:${PWD}/hmmer-3.1b2-linux-intel-x86_64/binaries
      - wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip
      - unzip bowtie2-2.3.2-legacy-linux-x86_64.zip
      - export PATH=${PATH}:${PWD}/bowtie2-2.3.2-legacy
      - bowtie2 --version
      - wget https://github.com/relipmoc/skewer/archive/0.2.2.tar.gz
      - tar -xvf 0.2.2.tar.gz
      - cd skewer-0.2.2
      - make
      - cd ..
      - export PATH=${PATH}:${PWD}/skewer-0.2.2
      - skewer --version
      - wget https://github.com/ablab/spades/releases/download/v3.11.0/SPAdes-3.11.0-Linux.tar.gz
      - tar -xvf SPAdes-3.11.0-Linux.tar.gz
      - export PATH=${PATH}:${PWD}/SPAdes-3.11.0-Linux/bin
      - spades.py --version
      install:
      - pip install -r requirements.txt
      - rm -rf ~/.nvm
      - git clone https://github.com/creationix/nvm.git ~/.nvm
      - cd ~/.nvm
      - git checkout `git describe --abbrev=0 --tags`
      - source ~/.nvm/nvm.sh
      - nvm install $TRAVIS_NODE_VERSION
      - npm install -g yarn
      - npm install -g webpack@v3.11.0
      - cd $TRAVIS_BUILD_DIR
      - cd client
      - yarn install
      - webpack --config webpack.production.config.babel.js
      - cd $TRAVIS_BUILD_DIR
      before_script:
      - sleep 15
      script:
      - pytest --loop uvloop --cov --cov-report xml
      - mkdir gh_build
      - mkdir gh_build/virtool
      - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
      - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); print(flags&os.O_NONBLOCK);'
      - python setup.py build
      - ls -lh build/exe.linux-x86_64-3.6
      - cp -rv build/exe.linux-x86_64-3.6/* gh_build/virtool
      - cp -rv assets gh_build/virtool
      - cp -rv templates gh_build/virtool
      - cp -rv client/dist gh_build/virtool/client
      - cp -v LICENSE gh_build/virtool
      - cp -v readme.md gh_build/virtool
      - echo $TRAVIS_TAG > gh_build/virtool/VERSION
      - cd gh_build
      - tar -cvzf virtool.tar.gz virtool
      - tar -tvf virtool.tar.gz
      - cd ..
      after_script:
      - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then python-codacy-coverage -r coverage.xml;
        fi
      deploy:
        - provider: releases
          skip_cleanup: true
          api_key:
            secure: <KEY>
          file: gh_build/virtool.tar.gz
          on:
            tags: true

        - provider: releases
          skip_cleanup: true
          api_key:
            secure: <KEY>5Nhfgum965uFuOcsYaEilQSGzqRdIJFhBxyp+ow9Cnq0acmffm+W7jT+m0v2IvUlDkthAPSIBDLRrjOECTUXB7VorSusrK6J3hBcdkl6J58DfNi55N2px8KB7w=
          file: gh_build/virtool.tar.gz
          draft: true

    - language: node_js
      node_js:
      - '6'
      cache:
        yarn: true
        directories:
        - client/node_modules
      before_script:
      - cd $TRAVIS_BUILD_DIR
      - cd client
      - yarn install
      script:
      - yarn test --maxWorkers=4
{'fraction_non_alphanumeric': 0.12301166489925769, 'fraction_numerical': 0.03035524920466596, 'mean_word_length': 1.7023638968481376, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '701808', 'n_tokens_mistral': 2949, 'n_tokens_neox': 2791, 'n_words': 488}