<commit_before>sudo: required
dist: trusty
language: rust

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - binutils-dev
      - php5-dev
      - php5-cli

rust:
  - stable
  - beta
  - nightly

before_script:
  - |
      pip install 'travis-cargo<0.2' --user
      export PATH=$HOME/.local/bin:$PATH
      export LIBRARY_PATH=$HOME/lib
      export LD_LIBRARY_PATH=$HOME/lib
      export PKG_CONFIG_PATH=$HOME/lib/pkgconfig

      cd /tmp
      curl -sSOL https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz
      curl -sSOL https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz.sig
      curl -sSOL https://download.libsodium.org/jedi.gpg.asc
      gpg --import jedi.gpg.asc
      gpg --verify libsodium-1.0.8.tar.gz.sig libsodium-1.0.8.tar.gz
      tar zxf libsodium-1.0.8.tar.gz
      cd libsodium-1.0.8
      ./configure --prefix=$HOME && make && make install
      cd ..

      curl -sSOL https://github.com/zeromq/zeromq4-1/archive/v4.1.4.tar.gz
      tar zxf v4.1.4.tar.gz
      cd zeromq4-1-4.1.4
      ./autogen.sh && ./configure --prefix=$HOME --with-libsodium && make && make install
      cd ..

      git clone https://github.com/zeromq/czmq
      cd czmq
      ./autogen.sh && ./configure --prefix=$HOME && make && make install
      cd $TRAVIS_BUILD_DIR

script:
  - travis-cargo build
  - travis-cargo test
  - travis-cargo bench
  - |
      cd bindings/php
      ln -s ../c include
      ln -s "$HOME/lib/libczmq.so.3" ../../target/debug
      ln -s "$HOME/lib/libzmq.so.5" ../../target/debug
      phpize
      ./configure --with-inapi=../../target/debug
      make
      TEST_PHP_ARGS="-q" make test || exit 1
      cd ../..

after_success:
  - travis-cargo coveralls --no-sudo --verify --exclude-pattern="/tmp/,/usr/"

env:
  - TRAVIS_CARGO_NIGHTLY_FEATURE=""<commit_msg>Attempt to fix Travis for multiple PHP version builds<commit_after>sudo: required
dist: trusty
language: rust

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - binutils-dev

      - php5-dev
      - php5-cli
      - php5-json
      - php-pear
      - autoconf
      - automake
      - curl
      - build-essential
      - libxslt1-dev
      - re2c
      - libxml2
      - libxml2-dev
      - bison
      - libbz2-dev
      - libreadline-dev
      - libicu-dev

rust:
  - stable
  - beta
  - nightly

before_script:
  - |
      pip install 'travis-cargo<0.2' --user
      export PATH=$HOME/.local/bin:$PATH
      export LIBRARY_PATH=$HOME/lib
      export LD_LIBRARY_PATH=$HOME/lib
      export PKG_CONFIG_PATH=$HOME/lib/pkgconfig

      cd /tmp
      curl -sSOL https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz
      curl -sSOL https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz.sig
      curl -sSOL https://download.libsodium.org/jedi.gpg.asc
      gpg --import jedi.gpg.asc
      gpg --verify libsodium-1.0.8.tar.gz.sig libsodium-1.0.8.tar.gz
      tar zxf libsodium-1.0.8.tar.gz
      cd libsodium-1.0.8
      ./configure --prefix=$HOME && make && make install
      cd ..

      curl -sSOL https://github.com/zeromq/zeromq4-1/archive/v4.1.4.tar.gz
      tar zxf v4.1.4.tar.gz
      cd zeromq4-1-4.1.4
      ./autogen.sh && ./configure --prefix=$HOME --with-libsodium && make && make install
      cd ..

      git clone https://github.com/zeromq/czmq
      cd czmq
      ./autogen.sh && ./configure --prefix=$HOME && make && make install
      cd $TRAVIS_BUILD_DIR

      curl -L -o "$HOME/.local/bin/phpbrew" https://github.com/phpbrew/phpbrew/raw/master/phpbrew
      chmod +x $HOME/.local/bin/phpbrew

script:
  - travis-cargo build
  - travis-cargo test
  - travis-cargo bench
  - |
      ln -s "$HOME/lib/libczmq.so.3" target/debug
      ln -s "$HOME/lib/libzmq.so.5" target/debug

      phpbrew init
      . $HOME/.phpbrew/bashrc

      cd bindings

      export PHP5_VERSION=5.6
      export PHP7_VERSION=7.0

      for MAJ in 5 7
      do
        MIN="PHP${MAJ}_VERSION"
        phpbrew install -j $(nproc) --no-install ${!MIN} +debug
        cd "php$MAJ"
        ln -s ../c include
        chmod +x $PHPBREW_ROOT/build/php-${!MIN}.*/scripts/phpize
        $PHPBREW_ROOT/build/php-${!MIN}.*/scripts/phpize
        ./configure --with-inapi=../../target/debug
        make
        TEST_PHP_ARGS="-q" make test || exit 1
        cd ..
      done

      cd ..

after_success:
  - travis-cargo coveralls --no-sudo --verify --exclude-pattern="/tmp/,/usr/"

env:
  - TRAVIS_CARGO_NIGHTLY_FEATURE=""
{'fraction_non_alphanumeric': 0.1431684462845936, 'fraction_numerical': 0.020047940727827413, 'mean_word_length': 1.8867924528301887, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7263937', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1677, 'n_words': 315}