<commit_before># 'sudo required' will give os 7,5 GB memory, but has slower startup times, as we start a VM instead of a Container
sudo: required
language: python
cache: pip

python: 2.7

jobs:
  include:
    - stage: lint
      before_install: skip
      install:
        - pip install flake8 flake8-import-order planemo
        - planemo --version
        - echo $TRAVIS_COMMIT_RANGE
        - |
          planemo ci_find_repos --exclude_from .tt_blacklist \
                                --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                                --output changed_repositories.list
        - cat changed_repositories.list
      script:
        - set -e
        - cd "$TRAVIS_BUILD_DIR" && flake8 --exclude=.git .
        - while read -r DIR; do planemo shed_lint --tools --ensure_metadata --urls --report_level warn --fail_level error --recursive "$DIR"; done < changed_repositories.list

    - stage: test
      env: CHUNK=0

    - stage: test
      env: CHUNK=1

    - stage: test
      env: CHUNK=2

    - stage: deploy
      before_install: skip
      install:
        - pip install planemo
        - planemo --version
        - echo $TRAVIS_COMMIT_RANGE
        - |
          planemo ci_find_repos --exclude_from .tt_blacklist \
                                --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                                --output changed_repositories.list
        - cat changed_repositories.list
      script:
        - set -e
        - |
          if [ "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ]; then
              while read -r DIR; do planemo shed_update --shed_target testtoolshed --shed_email "$SHED_EMAIL" --shed_password "$<PASSWORD>" --force_repository_creation "$DIR" || exit 1; done < changed_repositories.list
              while read -r DIR; do planemo shed_update --shed_target toolshed --shed_email "$SHED_EMAIL" --shed_password "$<PASSWORD>" --force_repository_creation "$DIR" || exit 1; done < changed_repositories.list
          fi

before_install:
  - export GALAXY_REPO=https://github.com/galaxyproject/galaxy
  - export GALAXY_RELEASE=release_17.05
  - export PLANEMO_CONDA_PREFIX="$HOME/conda"
  - unset JAVA_HOME

install:
  #samtools is required to parse test outputs
  - apt-get -y install samtools	  
  - pip install planemo
  - planemo conda_init
  - export PATH="$PLANEMO_CONDA_PREFIX/bin:$PATH"
  - planemo --version
  - conda --version
  - git diff --quiet "$TRAVIS_COMMIT_RANGE" -- ; GIT_DIFF_EXIT_CODE=$?
  - |
    if [ "$GIT_DIFF_EXIT_CODE" -gt 1 ] ; then
        git remote set-branches --add origin master
        git fetch
        TRAVIS_COMMIT_RANGE=origin/master...
    fi
  - echo $TRAVIS_COMMIT_RANGE
  - |
    planemo ci_find_repos --exclude data_managers \
                          --exclude packages \
                          --exclude_from .tt_blacklist \
                          --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                          --output changed_repositories.list
  - touch changed_repositories_chunk.list changed_tools_chunk.list
  - |
    if [ -s changed_repositories.list ]; then
        if [ $(wc -l < changed_repositories.list) -eq 1 ]; then
            planemo ci_find_tools --chunk_count 3 --chunk "${CHUNK}" \
                                  --output changed_tools_chunk.list \
                                  $(cat changed_repositories.list)
        else
            planemo ci_find_repos --chunk_count 3 --chunk "${CHUNK}" \
                                  --output changed_repositories_chunk.list \
                                  $(cat changed_repositories.list)
        fi<commit_msg>correct syntax to install samtools<commit_after># 'sudo required' will give os 7,5 GB memory, but has slower startup times, as we start a VM instead of a Container
sudo: required
language: python
cache: pip

python: 2.7

jobs:
  include:
    - stage: lint
      before_install: skip
      install:
        - pip install flake8 flake8-import-order planemo
        - planemo --version
        - echo $TRAVIS_COMMIT_RANGE
        - |
          planemo ci_find_repos --exclude_from .tt_blacklist \
                                --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                                --output changed_repositories.list
        - cat changed_repositories.list
      script:
        - set -e
        - cd "$TRAVIS_BUILD_DIR" && flake8 --exclude=.git .
        - while read -r DIR; do planemo shed_lint --tools --ensure_metadata --urls --report_level warn --fail_level error --recursive "$DIR"; done < changed_repositories.list

    - stage: test
      env: CHUNK=0

    - stage: test
      env: CHUNK=1

    - stage: test
      env: CHUNK=2

    - stage: deploy
      before_install: skip
      install:
        - pip install planemo
        - planemo --version
        - echo $TRAVIS_COMMIT_RANGE
        - |
          planemo ci_find_repos --exclude_from .tt_blacklist \
                                --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                                --output changed_repositories.list
        - cat changed_repositories.list
      script:
        - set -e
        - |
          if [ "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ]; then
              while read -r DIR; do planemo shed_update --shed_target testtoolshed --shed_email "$SHED_EMAIL" --shed_password "$<PASSWORD>" --force_repository_creation "$DIR" || exit 1; done < changed_repositories.list
              while read -r DIR; do planemo shed_update --shed_target toolshed --shed_email "$SHED_EMAIL" --shed_password "$<PASSWORD>" --force_repository_creation "$DIR" || exit 1; done < changed_repositories.list
          fi

before_install:
  - export GALAXY_REPO=https://github.com/galaxyproject/galaxy
  - export GALAXY_RELEASE=release_17.05
  - export PLANEMO_CONDA_PREFIX="$HOME/conda"
  - unset JAVA_HOME

addons:
  apt:
    packages:
    - samtools

install:
  - pip install planemo
  - planemo conda_init
  - export PATH="$PLANEMO_CONDA_PREFIX/bin:$PATH"
  - planemo --version
  - conda --version
  - git diff --quiet "$TRAVIS_COMMIT_RANGE" -- ; GIT_DIFF_EXIT_CODE=$?
  - |
    if [ "$GIT_DIFF_EXIT_CODE" -gt 1 ] ; then
        git remote set-branches --add origin master
        git fetch
        TRAVIS_COMMIT_RANGE=origin/master...
    fi
  - echo $TRAVIS_COMMIT_RANGE
  - |
    planemo ci_find_repos --exclude data_managers \
                          --exclude packages \
                          --exclude_from .tt_blacklist \
                          --changed_in_commit_range "$TRAVIS_COMMIT_RANGE" \
                          --output changed_repositories.list
  - touch changed_repositories_chunk.list changed_tools_chunk.list
  - |
    if [ -s changed_repositories.list ]; then
        if [ $(wc -l < changed_repositories.list) -eq 1 ]; then
            planemo ci_find_tools --chunk_count 3 --chunk "${CHUNK}" \
                                  --output changed_tools_chunk.list \
                                  $(cat changed_repositories.list)
        else
            planemo ci_find_repos --chunk_count 3 --chunk "${CHUNK}" \
                                  --output changed_repositories_chunk.list \
                                  $(cat changed_repositories.list)
        fi
{'fraction_non_alphanumeric': 0.09353206618350882, 'fraction_numerical': 0.005469711472719814, 'mean_word_length': 1.85480093676815, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7335233', 'n_tokens_mistral': 2312, 'n_tokens_neox': 2199, 'n_words': 530}