language: rust
rust: 1.40.0
sudo: true
cache:
timeout: 1024
directories:
- $HOME/.cargo
if: 'branch = master OR type != push OR fork = true OR tag =~ ^v'
env:
global:
- RUST_BACKTRACE=full
matrix:
include:
- os: osx
install:
- cargo fmt --version || rustup component add rustfmt
- cargo clippy --version || rustup component add clippy
- os: linux
install:
- cargo fmt --version || travis_retry rustup component add rustfmt
- cargo clippy --version || travis_retry rustup component add clippy
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cargo fmt -- --check; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cargo clippy; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make test; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make ci; fi
before_cache:
- rm -rf $HOME/.cargo/registry