<commit_before>language: rust

addons:
  apt:
    sources:
    - sourceline: 'ppa:giskou/librocksdb'
    packages:
    - gcc
    - g++
    - libssl-dev
    - libcurl4-openssl-dev
    - libelf-dev
    - libdw-dev
    - binutils-dev
    - libiberty-dev
    - libsnappy-dev
    - librocksdb

rust:
  # Feel free to bump this version if you need features of newer Rust.
  # Sync with badge in README.md
  - 1.23.0

matrix:
  allow_failures:
  - env: FEATURE=non-fatal-checks
  fast_finish: true

cache:
  directories:
  - node_modules
  - $HOME/.cargo
  - $HOME/.local
  - $TRAVIS_BUILD_DIR/target
  - $TRAVIS_BUILD_DIR/sandbox/target

dist: trusty
sudo: required

env:
  global:
  - CLIPPY_VERS=0.0.181
  - RUSTFMT_VERS=0.9.0
  - DEADLINKS_VERS=0.3.0
  - OUTDATED_VERS=0.7.0
  - SODIUM_VERS=1.0.13
  - CARGO_INCREMENTAL=1
  - RUSTFLAGS="-C link-dead-code -D warnings"
  - CODECOV_TOKEN=<PASSWORD>
  - ROCKSDB_LIB_DIR=/usr/lib/x86_64-linux-gnu
  - SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
  matrix:
  - FEATURE=test

# Separate jobs should use `install` hook in order not to override these common
# instructions.
before_install:
- |
  if [ ! -f "$HOME/.local/lib/libsodium.a" ]; then
    wget "https://github.com/jedisct1/libsodium/releases/download/$SODIUM_VERS/libsodium-$SODIUM_VERS.tar.gz" -t 5 -O "libsodium.tar.gz"
    tar xvf libsodium.tar.gz
    cd libsodium-$SODIUM_VERS
    ./configure --prefix=$HOME/.local
    make
    make install
    cd ..
  fi
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig

jobs:
  include:
  # Formatting & other lints that do not require compilation
  - env: FEATURE=lints
    install:
    - cargo-audit -V || cargo install cargo-audit --force
    - rustfmt -V | grep $RUSTFMT_VERS || cargo install rustfmt --vers $RUSTFMT_VERS --force
    - nvm install 8 && nvm use 8
    - npm install cspell
    - ./node_modules/.bin/cspell --version
    - npm install markdownlint-cli
    - ./node_modules/.bin/markdownlint --version
    script:
    - cargo fmt --all -- --write-mode=diff
    - ./node_modules/.bin/cspell sandbox/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell exonum/{src,benches,tests}/**/*.rs
    - ./node_modules/.bin/cspell exonum/fuzz/fuzz_targets/*.rs
    - ./node_modules/.bin/cspell testkit/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell services/configuration/{src,examples}/**/*.rs
    - ./node_modules/.bin/cspell services/time/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell examples/cryptocurrency/{src,examples,tests}/**/*.rs
    - find . -not -path "./3rdparty/*" -and -not -path "./node_modules/*" -name "*.md" | xargs ./node_modules/.bin/cspell
    - find . -not -path "./3rdparty/*" -and -not -path "./node_modules/*" -name "*.md" | xargs ./node_modules/.bin/markdownlint --config .markdownlintrc

  # Clippy linting
  - env: FEATURE=clippy
    rust: nightly-2018-01-22
    install:
    - cargo clippy --version | grep $CLIPPY_VERS || cargo install clippy --force --vers $CLIPPY_VERS
    script:
    - cargo clippy --all -- -D warnings

  # Tests
  - env: FEATURE=test
    addons:
      apt:
        sources:
        - sourceline: 'ppa:giskou/librocksdb'
        - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main'
          key_url: https://packages.microsoft.com/keys/microsoft.asc
        packages:
        - gcc
        - g++
        - libssl-dev
        - libcurl4-openssl-dev
        - libelf-dev
        - libdw-dev
        - binutils-dev
        - libiberty-dev
        - libsnappy-dev
        - librocksdb
        - powershell
    script:
    - cargo test --all
    - cargo run -p exonum-testkit --example timestamping
    - cargo run -p exonum-testkit --example configuration_change
    - cargo run -p exonum-time --example simple_service
    - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
    - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1

  # Benchmarks (compilation only)
  - env: FEATURE=benchmarks
    rust: nightly-2018-01-22
    script:
    - RUST_LOG=off cargo bench --verbose --manifest-path exonum/Cargo.toml --features long_benchmarks --no-run

  # Non-fatal checks
  - env: FEATURE=non-fatal-checks
    install:
    - cargo-deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
    script:
    - cargo doc --no-deps
    - touch target/doc/exonum/encoding/serialize/trait.Serialize.html  # TODO: a tmp hack to ignore a warning about missing page [ECR-703]
    - cargo deadlinks --dir target/doc

notifications:
  slack:
    secure: <KEY>
  webhooks:
    urls:
    - https://webhooks.gitter.im/e/9599da7e3a500810190d
<commit_msg>.travis.yml: Remove sandbox/target from cache<commit_after>language: rust

addons:
  apt:
    sources:
    - sourceline: 'ppa:giskou/librocksdb'
    packages:
    - gcc
    - g++
    - libssl-dev
    - libcurl4-openssl-dev
    - libelf-dev
    - libdw-dev
    - binutils-dev
    - libiberty-dev
    - libsnappy-dev
    - librocksdb

rust:
  # Feel free to bump this version if you need features of newer Rust.
  # Sync with badge in README.md
  - 1.23.0

matrix:
  allow_failures:
  - env: FEATURE=non-fatal-checks
  fast_finish: true

cache:
  directories:
  - node_modules
  - $HOME/.cargo
  - $HOME/.local
  - $TRAVIS_BUILD_DIR/target

dist: trusty
sudo: required

env:
  global:
  - CLIPPY_VERS=0.0.181
  - RUSTFMT_VERS=0.9.0
  - DEADLINKS_VERS=0.3.0
  - OUTDATED_VERS=0.7.0
  - SODIUM_VERS=1.0.13
  - CARGO_INCREMENTAL=1
  - RUSTFLAGS="-C link-dead-code -D warnings"
  - CODECOV_TOKEN=<PASSWORD>
  - ROCKSDB_LIB_DIR=/usr/lib/x86_64-linux-gnu
  - SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
  matrix:
  - FEATURE=test

# Separate jobs should use `install` hook in order not to override these common
# instructions.
before_install:
- |
  if [ ! -f "$HOME/.local/lib/libsodium.a" ]; then
    wget "https://github.com/jedisct1/libsodium/releases/download/$SODIUM_VERS/libsodium-$SODIUM_VERS.tar.gz" -t 5 -O "libsodium.tar.gz"
    tar xvf libsodium.tar.gz
    cd libsodium-$SODIUM_VERS
    ./configure --prefix=$HOME/.local
    make
    make install
    cd ..
  fi
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig

jobs:
  include:
  # Formatting & other lints that do not require compilation
  - env: FEATURE=lints
    install:
    - cargo-audit -V || cargo install cargo-audit --force
    - rustfmt -V | grep $RUSTFMT_VERS || cargo install rustfmt --vers $RUSTFMT_VERS --force
    - nvm install 8 && nvm use 8
    - npm install cspell
    - ./node_modules/.bin/cspell --version
    - npm install markdownlint-cli
    - ./node_modules/.bin/markdownlint --version
    script:
    - cargo fmt --all -- --write-mode=diff
    - ./node_modules/.bin/cspell sandbox/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell exonum/{src,benches,tests}/**/*.rs
    - ./node_modules/.bin/cspell exonum/fuzz/fuzz_targets/*.rs
    - ./node_modules/.bin/cspell testkit/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell services/configuration/{src,examples}/**/*.rs
    - ./node_modules/.bin/cspell services/time/{src,examples,tests}/**/*.rs
    - ./node_modules/.bin/cspell examples/cryptocurrency/{src,examples,tests}/**/*.rs
    - find . -not -path "./3rdparty/*" -and -not -path "./node_modules/*" -name "*.md" | xargs ./node_modules/.bin/cspell
    - find . -not -path "./3rdparty/*" -and -not -path "./node_modules/*" -name "*.md" | xargs ./node_modules/.bin/markdownlint --config .markdownlintrc

  # Clippy linting
  - env: FEATURE=clippy
    rust: nightly-2018-01-22
    install:
    - cargo clippy --version | grep $CLIPPY_VERS || cargo install clippy --force --vers $CLIPPY_VERS
    script:
    - cargo clippy --all -- -D warnings

  # Tests
  - env: FEATURE=test
    addons:
      apt:
        sources:
        - sourceline: 'ppa:giskou/librocksdb'
        - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main'
          key_url: https://packages.microsoft.com/keys/microsoft.asc
        packages:
        - gcc
        - g++
        - libssl-dev
        - libcurl4-openssl-dev
        - libelf-dev
        - libdw-dev
        - binutils-dev
        - libiberty-dev
        - libsnappy-dev
        - librocksdb
        - powershell
    script:
    - cargo test --all
    - cargo run -p exonum-testkit --example timestamping
    - cargo run -p exonum-testkit --example configuration_change
    - cargo run -p exonum-time --example simple_service
    - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
    - cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1

  # Benchmarks (compilation only)
  - env: FEATURE=benchmarks
    rust: nightly-2018-01-22
    script:
    - RUST_LOG=off cargo bench --verbose --manifest-path exonum/Cargo.toml --features long_benchmarks --no-run

  # Non-fatal checks
  - env: FEATURE=non-fatal-checks
    install:
    - cargo-deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
    script:
    - cargo doc --no-deps
    - touch target/doc/exonum/encoding/serialize/trait.Serialize.html  # TODO: a tmp hack to ignore a warning about missing page [ECR-703]
    - cargo deadlinks --dir target/doc

notifications:
  slack:
    secure: <KEY>
  webhooks:
    urls:
    - https://webhooks.gitter.im/e/9599da7e3a500810190d

{'fraction_non_alphanumeric': 0.13554691604497215, 'fraction_numerical': 0.016812020594725228, 'mean_word_length': 2.495409474843922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, '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': '3564350', 'n_tokens_mistral': 3648, 'n_tokens_neox': 3424, 'n_words': 691}