language: rust
rust:
- nightly
before_script: |
rustup component add clippy-preview;
if ! rustup component add clippy; then
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy`;
echo "'clippy' is unavailable on the toolchain 'nightly', using the toolchain 'nightly-$target' instead";
rustup toolchain install nightly-$target;
rustup default nightly-$target;
rustup component add clippy;
fi
rustup component add rustfmt-preview;
if ! rustup component add rustfmt; then
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt`;
echo "'rustfmt' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
rustup toolchain install nightly-$target;
rustup default nightly-$target;
rustup component add rustfmt;
fi
script: |
cargo fmt -- --check &&
cargo clippy -- -D clippy &&
cargo build --verbose &&
cargo test --verbose
cache: cargo