os_info 0.4.0

Detect the operating system type and version.
Documentation
language: rust

os:
  - linux
  - osx

rust:
- stable
# TODO: add beta and nightly.

cache: cargo

env:
  global:
  - CLIPPY_VERS=0.0.142
  - RUSTFMT_VERS=0.9.0
  - DEADLINKS_VERS=0.2.1

install:
- |

  if [[ "$FEATURE" == "clippy" ]]; then
    cargo clippy --version | grep $CLIPPY_VERS || cargo install clippy --force --vers $CLIPPY_VERS
  fi
- |

  if [[ "$FEATURE" == "fmt" ]]; then
    cargo-audit -V || cargo install cargo-audit --force
    rustfmt -V | grep $RUSTFMT_VERS || cargo install rustfmt --vers $RUSTFMT_VERS --force
    cargo update
  fi
- |

  if [[ "$FEATURE" == "docs" ]]; then
    cargo-deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
    cargo update
  fi
- cargo install --list

script: skip

jobs:
  include:
  - stage: format
    env:
    - FEATURE=fmt
    script:
    - cargo audit
    - cargo fmt -- --write-mode=diff
  - stage: docs
    env:
    - FEATURE=docs
    script:
    - cargo doc --no-deps
    - cargo deadlinks
  - stage: lint
    rust: nightly-2017-07-05
    env:
    - FEATURE=clippy
    script:
    - cargo clippy -- -D warnings
  - stage: test
    script:
    - cargo test