<commit_before>notifications:
  irc:
    channels:
#     - "chat.freenode.net#darktable"
      - secure: "<KEY>
    skip_join: true
    template:
      - "%{repository}#%{build_number} (\x037%{branch}\x03 - \x02%{commit}\x02 : \x033%{author}\x03): \x1f\x02%{message}\x02\x1f"
      - "Build details : <%{build_url}>"
  email:
    recipients:
#     - <EMAIL>
      - secure: "<KEY>
    on_success: always
    on_failure: always

language: generic

before_install:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master")) ]]; then
      exit;
    fi;
  - if [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then
      exit;
    fi;

install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" == "NODOCKER" ]]; then
      echo "oracle-java8-installer hold" | sudo dpkg --set-selections;
      echo "oracle-java9-installer hold" | sudo dpkg --set-selections;
      travis_retry sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
      travis_retry sudo apt-get update -q;
      travis_retry sudo apt-get install -y -q -f --fix-missing cmake g++-5 git libjpeg-dev libpugixml-dev libxml2-utils make ninja-build zlib1g-dev;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      travis_retry brew update > /dev/null && brew tap Homebrew/bundle && cd .ci && brew bundle --verbose;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$FLAVOR" == "Coverage" ]]; then
      travis_retry sudo apt-get install -y -q -f --fix-missing rsync;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" != "NODOCKER" ]]; then
      travis_retry travis_wait 5 docker pull darktable/rawspeed;
    fi;

before_script:
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$FLAVOR" == "Coverage" ]]; then
      travis_retry rsync -vvrLtW --preallocate --delete --compress --compress-level=1 --stats --progress rsync://raw.pixls.us/data-unique/ $HOME/$RPUU_DST && cd $HOME/$RPUU_DST && sha1sum -c --strict filelist.sha1;
    fi;

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - SRC_DIR=/build/rawspeed
    - BUILD_DIR=/build/rawspeed-build
    - INSTALL_PREFIX=/build/rawspeed-install
    - CFLAGS="-pipe" CXXFLAGS="-pipe"
    - TARGET=build
    - RPUU_DST="raw-camera-samples/raw.pixls.us-unique/"
    - DOCKER_RPUU="--volume $HOME/$RPUU_DST:/root/$RPUU_DST:ro"

jobs:
  fast_finish: true
  include:
  - stage: test
    os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8
  - os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8 GCOV=gcov-8 FLAVOR=Coverage ECO="-DRAWSPEED_ENABLE_SAMPLE_BASED_TESTING=ON" EXTRA_OPTS="$DOCKER_RPUU"
    cache:
      directories:
        - '$HOME/$RPUU_DST'
  #- os: osx
  #  env: CC=cc CXX=c++
  #- os: osx
  #  env: CC=cc CXX=c++ FLAVOR=Coverage
  - os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 TARGET=STATICANALYSIS ECO="-DUSE_CLANG_TIDY=ON"
  - os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 ECO="-DWITH_PTHREADS=OFF"
  - os: linux
    sudo: required
    dist: xenial
    edge: true
    env: CC=gcc-5 CXX=g++-5 EXTRA=NODOCKER
  - stage: deploy
    os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8 GCOV=gcov-8 TARGET=SONARQUBE FLAVOR=Coverage ECO="-DRAWSPEED_ENABLE_SAMPLE_BASED_TESTING=ON" EXTRA_OPTS="--tmpfs /root/.sonar --volume $HOME/.sonar/cache:/root/.sonar/cache $DOCKER_RPUU"
    git:
      depth: 9999999
    cache:
      directories:
        - '$HOME/$RPUU_DST'
        - '$HOME/.sonar/cache'
  - os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 TARGET=WWW

# linux clang Coverage build OOM's in gcov during final codecov report collection
# OSX gcc Coverage build produces invalid .gcno files

script:
  - set -e
  - if [[ ("$TRAVIS_OS_NAME" == "linux" && "$EXTRA" == "NODOCKER") || "$TRAVIS_OS_NAME" == "osx" ]]; then
      export SRC_DIR="$TRAVIS_BUILD_DIR";
      export BUILD_DIR="$SRC_DIR/build";
      export INSTALL_PREFIX="$SRC_DIR/install";
      export ECO="$ECO -DALLOW_DOWNLOADING_GOOGLETEST=ON";
      mkdir "$BUILD_DIR";
      mkdir "$INSTALL_PREFIX";
      "$SRC_DIR/.ci/ci-script.sh";
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" != "NODOCKER"  ]]; then
      mkdir "$TRAVIS_BUILD_DIR/build";<commit_msg>Partially revert "Travis-ci: attempt to use more newer infra, trying to workaround ${PLATFORM} expansion issue."<commit_after>notifications:
  irc:
    channels:
#     - "chat.freenode.net#darktable"
      - secure: "<KEY>
    skip_join: true
    template:
      - "%{repository}#%{build_number} (\x037%{branch}\x03 - \x02%{commit}\x02 : \x033%{author}\x03): \x1f\x02%{message}\x02\x1f"
      - "Build details : <%{build_url}>"
  email:
    recipients:
#     - <EMAIL>
      - secure: "<KEY>
    on_success: always
    on_failure: always

language: generic

before_install:
  - if [[ "$TARGET" == "SONARQUBE" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || ("$TRAVIS_BRANCH" != "develop" && "$TRAVIS_BRANCH" != "master")) ]]; then
      exit;
    fi;
  - if [[ "$TARGET" == "WWW" && ("$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_SECURE_ENV_VARS" != "true" || "$TRAVIS_BRANCH" != "develop") ]]; then
      exit;
    fi;

install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" == "NODOCKER" ]]; then
      echo "oracle-java8-installer hold" | sudo dpkg --set-selections;
      echo "oracle-java9-installer hold" | sudo dpkg --set-selections;
      travis_retry sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
      travis_retry sudo apt-get update -q;
      travis_retry sudo apt-get install -y -q -f --fix-missing cmake g++-5 git libjpeg-dev libpugixml-dev libxml2-utils make ninja-build zlib1g-dev;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      travis_retry brew update > /dev/null && brew tap Homebrew/bundle && cd .ci && brew bundle --verbose;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$FLAVOR" == "Coverage" ]]; then
      travis_retry sudo apt-get install -y -q -f --fix-missing rsync;
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" != "NODOCKER" ]]; then
      travis_retry travis_wait 5 docker pull darktable/rawspeed;
    fi;

before_script:
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$FLAVOR" == "Coverage" ]]; then
      travis_retry rsync -vvrLtW --preallocate --delete --compress --compress-level=1 --stats --progress rsync://raw.pixls.us/data-unique/ $HOME/$RPUU_DST && cd $HOME/$RPUU_DST && sha1sum -c --strict filelist.sha1;
    fi;

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - SRC_DIR=/build/rawspeed
    - BUILD_DIR=/build/rawspeed-build
    - INSTALL_PREFIX=/build/rawspeed-install
    - CFLAGS="-pipe" CXXFLAGS="-pipe"
    - TARGET=build
    - RPUU_DST="raw-camera-samples/raw.pixls.us-unique/"
    - DOCKER_RPUU="--volume $HOME/$RPUU_DST:/root/$RPUU_DST:ro"

jobs:
  fast_finish: true
  include:
  - stage: test
    os: linux
    dist: trusty
    sudo: required
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8
  - os: linux
    dist: trusty
    sudo: required
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8 GCOV=gcov-8 FLAVOR=Coverage ECO="-DRAWSPEED_ENABLE_SAMPLE_BASED_TESTING=ON" EXTRA_OPTS="$DOCKER_RPUU"
    cache:
      directories:
        - '$HOME/$RPUU_DST'
  #- os: osx
  #  env: CC=cc CXX=c++
  #- os: osx
  #  env: CC=cc CXX=c++ FLAVOR=Coverage
  - os: linux
    dist: trusty
    sudo: required
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 TARGET=STATICANALYSIS ECO="-DUSE_CLANG_TIDY=ON"
  - os: linux
    dist: trusty
    sudo: required
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 ECO="-DWITH_PTHREADS=OFF"
  - os: linux
    dist: trusty
    sudo: required
    env: CC=gcc-5 CXX=g++-5 EXTRA=NODOCKER
  - stage: deploy
    os: linux
    sudo: required
    dist: xenial
    edge: true
    services:
      - docker
    env: CC=gcc-8 CXX=g++-8 GCOV=gcov-8 TARGET=SONARQUBE FLAVOR=Coverage ECO="-DRAWSPEED_ENABLE_SAMPLE_BASED_TESTING=ON" EXTRA_OPTS="--tmpfs /root/.sonar --volume $HOME/.sonar/cache:/root/.sonar/cache $DOCKER_RPUU"
    git:
      depth: 9999999
    cache:
      directories:
        - '$HOME/$RPUU_DST'
        - '$HOME/.sonar/cache'
  - os: linux
    dist: trusty
    sudo: required
    services:
      - docker
    env: CC=clang-6.0 CXX=clang++-6.0 TARGET=WWW

# linux clang Coverage build OOM's in gcov during final codecov report collection
# OSX gcc Coverage build produces invalid .gcno files

script:
  - set -e
  - if [[ ("$TRAVIS_OS_NAME" == "linux" && "$EXTRA" == "NODOCKER") || "$TRAVIS_OS_NAME" == "osx" ]]; then
      export SRC_DIR="$TRAVIS_BUILD_DIR";
      export BUILD_DIR="$SRC_DIR/build";
      export INSTALL_PREFIX="$SRC_DIR/install";
      export ECO="$ECO -DALLOW_DOWNLOADING_GOOGLETEST=ON";
      mkdir "$BUILD_DIR";
      mkdir "$INSTALL_PREFIX";
      "$SRC_DIR/.ci/ci-script.sh";
    fi;
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$EXTRA" != "NODOCKER"  ]]; then
      mkdir "$TRAVIS_BUILD_DIR/build";
{'fraction_non_alphanumeric': 0.1591400061722045, 'fraction_numerical': 0.011932928711037958, 'mean_word_length': 2.8997192137986363, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1614791', 'n_tokens_mistral': 3952, 'n_tokens_neox': 3811, 'n_words': 791}