language: rust
cache: cargo
rust:
- stable
- beta
- nightly
if: type != push OR (tag IS blank AND branch = master)
addons:
apt:
packages:
- libudev
script:
- cargo test --examples
- cargo test --doc
- cargo test --lib
jobs:
allow_failures:
- rust: nightly
include:
- stage: check script: cargo check --all-targets
rust: stable
os: linux
- stage: test
rust: stable
os: osx
- rust: stable
os: windows
- stage: lint name: "Rust: beta, rustfmt"
rust: beta
os: linux
script:
- rustup component add rustfmt-preview
- cargo fmt -v -- --check
- name: "Rust: nightly, rustfmt" rust: nightly
os: linux
script:
- rustup component add rustfmt-preview
- cargo fmt -v -- --check
- name: "Rust: beta, clippy"
rust: beta
os: linux
script:
- rustup component add clippy-preview
- touch ./src/lib.rs && cargo clippy -- -D warnings
- name: "Rust: nightly, clippy"
rust: nightly
os: linux
script:
- rustup component add clippy-preview
- touch ./src/lib.rs && cargo clippy -- -D warnings
- stage: coverage
rust: nightly
os: linux
env: CACHE_NAME=coverage
script:
- RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --force cargo-tarpaulin || true
- cargo tarpaulin --out Xml
- bash <(curl -s https://codecov.io/bash)
- cargo clean
stages:
- check
- test
- lint
- coverage