language: rust
rust:
- 1.40.0
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
cache:
directories:
- node_modules
- $HOME/.cargo
- $HOME/.local
- $TRAVIS_BUILD_DIR/target
dist: trusty
sudo: required
env:
global:
- DEADLINKS_VERS=0.3.0
- CARGO_INCREMENTAL=1
matrix:
- FEATURE=test
jobs:
include:
- name: lints
install:
- cargo-audit -V || cargo install cargo-audit --force
- cargo-deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
- cargo install --list
- rustup component add rustfmt
- rustfmt -V
- nvm install 8 && nvm use 8
- npm install cspell
- ./node_modules/.bin/cspell --version
- npm install markdownlint-cli
- ./node_modules/.bin/markdownlint --version
script:
- cargo fmt --all -- --check
- ./node_modules/.bin/cspell src/**/*.rs
- ./node_modules/.bin/cspell examples/**/*.rs
- ./node_modules/.bin/cspell tests/**/*.rs
- find . -not -path "./node_modules/*" -not -path "./target/*" -name "*.md" | xargs ./node_modules/.bin/cspell
- find . -not -path "./node_modules/*" -not -path "./target/*" -name "*.md" | xargs ./node_modules/.bin/markdownlint
- cargo doc --no-deps
- cargo deadlinks --dir target/doc
- name: clippy
install:
- rustup component add clippy
- cargo clippy -V
script:
- cargo clippy --all -- -D warnings
- name: tests
script:
- cargo test --all
- cargo run --example print_version
- name: coverage
rust: nightly
before_install:
- sudo apt-get install -y libssl-dev
install:
- RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin -f
script:
- cargo tarpaulin --out Xml
- bash <(curl -s https://codecov.io/bash)