1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
language: rust
rust:
- 1.40.0
branches:
only:
- master
# Github release tags (for example "v0.9" or "v0.9.1").
- /^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:
# Formatting & other lints that do not require compilation.
- 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
# Clippy linting.
- name: clippy
install:
- rustup component add clippy
- cargo clippy -V
script:
- cargo clippy --all -- -D warnings
# Tests.
- name: tests
script:
- cargo test --all
- cargo run --example print_version
# Coverage.
- 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)
|