<commit_before>sudo: false

language: rust

rust:
  - stable
  # - beta
  # - nightly

env:
  global:
    - LOCAL="~/.local"  # install here to avoid `sudo`
  matrix:
    - TEST_DIR="code-coverage"
      PKGNAME="rust"    # must match with cargo.toml
    - TEST_DIR="syntax"
    - TEST_DIR="database/diesel"

services:
  - postgresql

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - libbfd-dev    # required for `--verify`

before_script: |
  export PATH=$LOCAL/bin:$PATH
  cd $TEST_DIR
  if [ "$TEST_DIR" = "database/diesel" ]; then
    psql -h localhost -U postgres -c "create user diesel createdb password '<PASSWORD>'"
    psql -h localhost -U postgres -c "create database diesel with owner diesel"
    cargo install diesel_cli
    diesel migration run
  fi

after_success: |
  if [ "$TEST_DIR" = "code-coverage" ]; then
    wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && 
      tar xzf master.tar.gz && 
      mkdir kcov-master/build && 
      cd kcov-master/build && 
      cmake -DCMAKE_INSTALL_PREFIX:PATH=$LOCAL .. && 
      make && 
      make install && 
      cd ../.. && 
      kcov --verify \
         --coveralls-id=$TRAVIS_JOB_ID \
         --exclude-pattern=/.cargo \
         target/kcov target/debug/$PKGNAME-*
  fi<commit_msg>travis ci for diesel demo<commit_after>sudo: false

language: rust

rust:
  - stable
  # - beta
  # - nightly

env:
  global:
    - LOCAL="~/.local"  # install here to avoid `sudo`
  matrix:
    - TEST_DIR="code-coverage"
      PKGNAME="rust"    # must match with cargo.toml
    - TEST_DIR="syntax"
    - TEST_DIR="database/diesel"

services:
  - postgresql

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - libbfd-dev    # required for `--verify`

before_script: |
  export PATH=$LOCAL/bin:~/.cargo/bin:$PATH
  cd $TEST_DIR
  if [ "$TEST_DIR" = "database/diesel" ]; then
    psql -h localhost -U postgres -c "create user diesel createdb password '<PASSWORD>'"
    psql -h localhost -U postgres -c "create database diesel with owner diesel"
    cargo install diesel_cli
    diesel migration run
  fi

after_success: |
  if [ "$TEST_DIR" = "code-coverage" ]; then
    wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && 
      tar xzf master.tar.gz && 
      mkdir kcov-master/build && 
      cd kcov-master/build && 
      cmake -DCMAKE_INSTALL_PREFIX:PATH=$LOCAL .. && 
      make && 
      make install && 
      cd ../.. && 
      kcov --verify \
         --coveralls-id=$TRAVIS_JOB_ID \
         --exclude-pattern=/.cargo \
         target/kcov target/debug/$PKGNAME-*
  fi
{'fraction_non_alphanumeric': 0.13001124016485574, 'fraction_numerical': 0.0007493443237167478, 'mean_word_length': 2.2481751824817517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '6287095', 'n_tokens_mistral': 976, 'n_tokens_neox': 915, 'n_words': 211}