-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
64 lines (57 loc) · 1.82 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
language: rust
dist: xenial
cache: cargo
sudo: required
rust:
- stable
env:
matrix:
- FEATURES=""
- FEATURES="--no-default-features"
- FEATURES="--no-default-features --features quoted-string-rfc2047"
addons:
apt:
packages:
# For codecov
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- libiberty-dev
# For sphinx
- python3-sphinx
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
script:
- eval cargo build --verbose $FEATURES
- eval cargo test --verbose $FEATURES
# Coverage report
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" && "$FEATURES" == "" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
(GLOBIGNORE='*.d'; for file in target/debug/rustyknife-*; do mkdir -p "target/cov/$(basename $file)"; kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done) &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
fi
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" && "$FEATURES" == "" ]]; then
cargo doc --no-default-features --features quoted-string-rfc2047 --features nightly &&
/usr/share/sphinx/scripts/python3/sphinx-build sphinx/source target/doc/sphinx &&
sudo pip install ghp-import &&
ghp-import -n target/doc &&
git push -fq "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" gh-pages
fi