<commit_before>language: generic

env:
  global:
    - CACHE="$HOME/.local"
    - MPICH_VER="3.1.4"
    - MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
    - MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
    - MPICH_DIR="$HOME/.local/usr/mpich"
    - MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
    - MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"

matrix:
  include:
    - os: osx
      env:
        - BUILD_TYPE="CodeCoverage"
          OSX_PACKAGES="gcc cmake"
    - os: osx
      env:
       - BUILD_TYPE="Release"
         OSX_PACKAGES="gcc cmake"
    - os: osx
      env:
       - BUILD_TYPE="InstallScript"
         OSX_PACKAGES="gcc"
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="CodeCoverage"
      cache:
        directories:
          - "$CACHE"
      addons:
        apt:
          sources:
            - george-edison55-precise-backports
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5
            - binutils
            - cmake-data
            - cmake
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="Release"
      cache:
        directories:
          - "$CACHE"
      addons:
        apt:
          sources:
            - george-edison55-precise-backports
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5
            - binutils
            - cmake-data
            - cmake
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="InstallScript"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5

before_install:
  - |
    if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
      export PATH="$PATH:$HOME/Library/Python/2.7/bin"
    else
      [[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
      [[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
      export PATH="$CACHE/bin:$PATH"
      export FC=gfortran-5
      export CC=gcc-5
      $FC --version
      $CC --version
    fi

install:
  - |
    if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
      brew update > /dev/null

      for pkg in $OSX_PACKAGES; do
        [[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
        brew outdated $pkg || brew upgrade --force-bottle $pkg
      done
      export FC=gfortran-5
      export CC=gcc-5
      if ! [[ "$(brew ls --versions mpich)" ]] && [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then
        wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
        brew install --force-bottle ${MPICH_BOT_URL_TAIL}
        if ! [[ "$(brew ls --versions mpich)" ]]; then
          brew install --force-bottle mpich
        fi
        mpif90 --version
        mpicc --version
        cmake --version
        export FC=mpif90
        export CC=mpicc
      elif [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then # uninstall some stuff if present
        [[ "$(brew ls --versions cmake)" ]] && brew rm cmake || true
        [[ "$(brew ls --versions mpich)" ]] && brew rm mpich || true
        [[ "$(brew ls --versions openmpi)" ]] && brew rm openmpi || true
      fi
    elif [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
      if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
        # mpich install not cached
        # could use prerequisites/build instead...
        wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
        mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
        pushd "$MPICH_DIR/.."
        tar -xzvf "$MPICH_URL_TAIL"
        cd "${MPICH_URL_TAIL%.tar.gz}"
        ./configure --prefix="$MPICH_DIR"
        make -j 4
        make install
        popd
        for f in "$MPICH_DIR/bin/"*; do
          if [[ -x "$f" ]]; then
            ln -fs "$f" "$HOME/.local/bin/${f##*/}" && "${f##*/}" --version
          fi
        done
      fi
      mpif90 --version
      mpicc --version
      cmake --version
      export FC=mpif90
      export CC=mpicc
    fi

script:
  - |
    if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
      export FC=gfortran-5
      export CC=gcc-5
      [[ -d "$HOME/opt" ]] || mkdir "$HOME/opt"
      [[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
      ln -fs "$(which gfortran-5)" "$HOME/bin/gfortran"
      ln -fs "$(which gcc-5)" "$HOME/bin/gcc"
      ln -fs "$(which g++-5)" "$HOME/bin/g++"
      export PATH="$PATH:$HOME/bin"
      yes | ./install.sh -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++"
    else
      mkdir cmake-build
      cd cmake-build
      cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
      make -j 4
      ctest --verbose
      make install
      cd ..
    fi

after_success:
  - find . -name '*.gcno' -print
  - gcov-5 --version
  - bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/93dbafbdf76c1732a623
      - https://webhooks.gitter.im/e/935231573bf1b9f2fe40
    on_success: change  # options: [always|never|change]
    on_failure: always
    on_start: always
<commit_msg>Fix CI silent failures<commit_after>language: generic

env:
  global:
    - CACHE="$HOME/.local"
    - MPICH_VER="3.1.4"
    - MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
    - MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
    - MPICH_DIR="$HOME/.local/usr/mpich"
    - MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
    - MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"

matrix:
  include:
    - os: osx
      env:
        - BUILD_TYPE="CodeCoverage"
          OSX_PACKAGES="gcc cmake"
    - os: osx
      env:
       - BUILD_TYPE="Release"
         OSX_PACKAGES="gcc cmake"
    - os: osx
      env:
       - BUILD_TYPE="InstallScript"
         OSX_PACKAGES="gcc"
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="CodeCoverage"
      cache:
        directories:
          - "$CACHE"
      addons:
        apt:
          sources:
            - george-edison55-precise-backports
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5
            - binutils
            - cmake-data
            - cmake
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="Release"
      cache:
        directories:
          - "$CACHE"
      addons:
        apt:
          sources:
            - george-edison55-precise-backports
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5
            - binutils
            - cmake-data
            - cmake
    - os: linux
      sudo: false
      env:
        - BUILD_TYPE="InstallScript"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - gcc-5
            - gfortran-5
            - g++-5

before_install:
  - |
    set -o errexit
    if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
      export PATH="$PATH:$HOME/Library/Python/2.7/bin"
    else
      [[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
      [[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
      export PATH="$CACHE/bin:$PATH"
      export FC=gfortran-5
      export CC=gcc-5
      $FC --version
      $CC --version
    fi
    set +o errexit

install:
  - |
    set -o errexit
    if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
      brew update > /dev/null

      for pkg in $OSX_PACKAGES; do
        [[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
        brew outdated $pkg || brew upgrade --force-bottle $pkg
      done
      export FC=gfortran-5
      export CC=gcc-5
      if ! [[ "$(brew ls --versions mpich)" ]] && [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then
        wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
        brew install --force-bottle ${MPICH_BOT_URL_TAIL}
        if ! [[ "$(brew ls --versions mpich)" ]]; then
          brew install --force-bottle mpich
        fi
        mpif90 --version
        mpicc --version
        cmake --version
        export FC=mpif90
        export CC=mpicc
      elif [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then # uninstall some stuff if present
        [[ "$(brew ls --versions cmake)" ]] && brew rm cmake || true
        [[ "$(brew ls --versions mpich)" ]] && brew rm mpich || true
        [[ "$(brew ls --versions openmpi)" ]] && brew rm openmpi || true
      fi
    elif [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
      if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
        # mpich install not cached
        # could use prerequisites/build instead...
        wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
        mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
        pushd "$MPICH_DIR/.."
        tar -xzvf "$MPICH_URL_TAIL"
        cd "${MPICH_URL_TAIL%.tar.gz}"
        ./configure --prefix="$MPICH_DIR"
        make -j 4
        make install
        popd
        for f in "$MPICH_DIR/bin/"*; do
          if [[ -x "$f" ]]; then
            ln -fs "$f" "$HOME/.local/bin/${f##*/}" && "${f##*/}" --version
          fi
        done
      fi
      mpif90 --version
      mpicc --version
      cmake --version
      export FC=mpif90
      export CC=mpicc
    fi
    set +o errexit

script:
  - |
    set -o errexit
    if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
      export FC=gfortran-5
      export CC=gcc-5
      [[ -d "$HOME/opt" ]] || mkdir "$HOME/opt"
      [[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
      ln -fs "$(which gfortran-5)" "$HOME/bin/gfortran"
      ln -fs "$(which gcc-5)" "$HOME/bin/gcc"
      ln -fs "$(which g++-5)" "$HOME/bin/g++"
      export PATH="$PATH:$HOME/bin"
      yes | ./install.sh -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++"
    else
      mkdir cmake-build
      cd cmake-build
      cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
      make -j 4
      ctest --verbose
      make install
      cd ..
    fi
    set +o errexit

after_success:
  - find . -name '*.gcno' -print
  - gcov-5 --version
  - bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/93dbafbdf76c1732a623
      - https://webhooks.gitter.im/e/935231573bf1b9f2fe40
    on_success: change  # options: [always|never|change]
    on_failure: always
    on_start: always

{'fraction_non_alphanumeric': 0.15225686365751512, 'fraction_numerical': 0.013959981386691484, 'mean_word_length': 1.7198177676537585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '7405567', 'n_tokens_mistral': 4035, 'n_tokens_neox': 3797, 'n_words': 785}