language: rust

rust:
  - stable
  - beta
  - nightly
sudo: true
dist: trusty
cache: cargo

before_install:
  - sudo apt-get install -y libssl-dev
  - sudo apt-get install -y pkg-config
  - sudo apt-get install -y openssl

install:
  #- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
  - cargo install diesel_cli --debug --no-default-features --features postgres
  - export PATH=$HOME/.cargo/bin:$PATH

before_script:
  #- diesel database setup
  - export PATH="$PATH:$HOME/.cargo/bin"
  - which rustfmt || cargo install rustfmt

script:
  - cargo fmt -- --write-mode=diff
  - cargo build
  - cargo test
  
after_success:
  #- travis-cargo coveralls --no-sudo

addons:
  postgresql: "9.5"
  apt:
    sources:
      - kalakris-cmake
    packages:
      - cmake
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev

matrix:
  allow_failures:
      - env: CLIPPY=YESPLEASE
  include:
    - rust: nightly
      env: CLIPPY=YESPLEASE
      script:
        cargo build --features "clippy"

env:
  global:
    - DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
    - TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test

notifications:
  email:
    on_success: never
  
language: rust

rust:
  - stable
  - beta
  - nightly
sudo: true
dist: trusty
cache: cargo

before_install:
  - sudo apt-get install -y libssl-dev
  - sudo apt-get install -y pkg-config
  - sudo apt-get install -y openssl

install:
  #- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
  - cargo install diesel_cli --debug --no-default-features --features postgres
  - export PATH=$HOME/.cargo/bin:$PATH

before_script:
  #- diesel database setup
  - export PATH="$PATH:$HOME/.cargo/bin"
  - which rustfmt || cargo install rustfmt

script:
  - cargo build
  - cargo test
  
after_success:
  #- travis-cargo coveralls --no-sudo

addons:
  postgresql: "9.5"
  apt:
    sources:
      - kalakris-cmake
    packages:
      - cmake
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev

matrix:
  allow_failures:
      - env: CLIPPY=YESPLEASE
  include:
    - rust: nightly
      env: CLIPPY=YESPLEASE
      script:
        - cargo fmt -- --write-mode=diff
        - cargo build --features "clippy"

env:
  global:
    - DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
    - TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test

notifications:
  email:
    on_success: never
  
Move rustfmt to the clippy script
CI: Move rustfmt to the clippy script

Signed-off-by: SirRade <8782a51767e43eefa2dd700c6a1ce6e0f7e9abf0@hotmail.de>
