-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
105 lines (94 loc) · 2.18 KB
/
.travis.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
language: rust
addons:
apt:
sources:
- sourceline: 'ppa:maarten-fonville/protobuf'
- sourceline: 'ppa:fsgmhoward/shadowsocks-libev'
packages:
- binutils-dev
- build-essential
- cmake
- g++
- gcc
- libcurl4-openssl-dev
- libdw-dev
- libelf-dev
- libiberty-dev
- libprotobuf-dev
- librocksdb-dev
- libsnappy-dev
- libsodium-dev
- libssl-dev
- pkg-config
- protobuf-compiler
- unzip
- zlib1g-dev
rust:
- 1.45.2
cache:
npm: true
cargo: false
directories:
- $HOME/.cache
- $HOME/.cargo
- $HOME/.local
- $HOME/.kcov
dist: bionic
sudo: required
env:
global:
- SCCACHE_VERS=0.2.13
- DEADLINKS_VERS=0.4.1
- RUSTFLAGS="-D warnings"
- ROCKSDB_LIB_DIR=/usr/lib
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
before_install:
- sccache -V | grep $SCCACHE_VERS || cargo install sccache --vers $SCCACHE_VERS --force
- export RUSTC_WRAPPER=sccache
jobs:
allow_failures:
- name: publish-with-rust
- name: deadlinks
include:
# Formatting & other lints that do not require compilation
- name: lints
install:
- rustup component add rustfmt
- rustfmt -V
- nvm install 12 && nvm use 12
- npm install
- ./node_modules/.bin/cspell --version
- ./node_modules/.bin/markdownlint --version
script:
- cargo fmt -- --check
- npm run cspell
- npm run md
# Clippy linting
- name: clippy
install:
- rustup component add clippy
- cargo clippy --version
script:
# Force clippy to use sccache, from issue
# https://github.com/mozilla/sccache/issues/423#issuecomment-526614168
- cargo check
- touch Cargo.toml
- cargo clippy --all -- -D warnings
# Tests
- name: linux-tests
script:
- cargo test --all
# Non-fatal checks
- name: deadlinks
env: FEATURE=non-fatal-checks
install:
- cargo-deadlinks -V | grep $DEADLINKS_VERS || cargo install cargo-deadlinks --vers $DEADLINKS_VERS --force
script:
- cargo doc --no-deps
- cargo deadlinks --dir target/doc
# Check publish with Rust 1.45.2
- name: publish-with-rust
env: FEATURE=non-fatal-checks
rust: 1.45.2
script:
- cargo publish --dry-run