This repository has been archived by the owner on Oct 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
87 lines (87 loc) · 3.46 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
sudo: false
language: rust
# necessary for `travis-cargo coveralls --no-sudo`
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev # optional: only required for the --verify flag of coveralls
# run builds for all the trains (and more)
rust:
- nightly
- beta
# check that it compiles on the latest stable compiler
- stable
cache:
directories:
- $HOME/.cargo
before_script:
# load travis-cargo
- |
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin/:$PATH
# install rustfmt
- |
(cargo install rustfmt || true) &&
export PATH=$PATH:$HOME/.cargo/bin
install:
# install libsodium
- wget https://github.com/jedisct1/libsodium/releases/download/1.0.8/libsodium-1.0.8.tar.gz
- tar xvfz libsodium-1.0.8.tar.gz
- cd libsodium-1.0.8 && ./configure --prefix=$HOME/installed_libsodium && make && make install &&
cd ..
- export PKG_CONFIG_PATH=$HOME/installed_libsodium/lib/pkgconfig:$PKG_CONFIG_PATH
- export LD_LIBRARY_PATH=$HOME/installed_libsodium/lib:$LD_LIBRARY_PATH
# the main build
script:
# run rustfmt
- cargo fmt -- --write-mode diff
- |
echo "Compiling" &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
travis-cargo build -- --no-default-features --features "nightly $CARGO_FEATURES"
else
travis-cargo build -- --features "$CARGO_FEATURES"
fi
- |
echo "Testing" &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
travis-cargo test -- --no-default-features --features "nightly $CARGO_FEATURES"
else
travis-cargo test -- --features "$CARGO_FEATURES"
fi
- |
echo "Benchmarking" &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
travis-cargo bench -- --no-default-features --features "nightly $CARGO_FEATURES"
else
travis-cargo bench -- --features "$CARGO_FEATURES"
fi
- echo "Generating docs (if on stable)" && travis-cargo --only stable doc -- --features "$CARGO_FEATURES"
after_success:
# upload the documentation from the build with stable (automatically only
# actually runs from the master branch, not individual PRs)
- travis-cargo --only stable doc-upload
# measure code coverage and upload to coveralls.io (the verify argument
# mitigates kcov crashes due to malformed debuginfo, at the cost of some
# speed. <https://github.com/huonw/travis-cargo/issues/12>)
- travis-cargo coveralls --no-sudo --verify
env:
global:
- RUST_BACKTRACE=1
- CARGO_FEATURES="all"
# override the default '--features unstable' used for the nightly branch
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
# encrypted Github token for doc upload
- secure: a8+XUVzRn+egVATXk9xlSA5275O4ipp0k+Ngop5tghl7fipVIYhTVnkNp33d/W4kO6BUdQOi1wv+2hPDK1/CzjTPl7ln9XIIqv42yYBSfJ6YX7bGnvCJLy82KpY7bIRNR6LEOro8cZVRb9Tub3epY0BgnMSECFklqxwVx1zfnP/Urd+W/i5BQXi66fSU4GttdPAYQjjJfVZDRUS2W/l5ZmHczVt1+ILMsvR9aFHfU3NG6p7eNE0u0UWQ/TwLERz3etDY5oyba2buAGnSLyxiJjXGcS6JRRbN4OVzVNEQckJYo1h5OvWLjQlFK2N/EEnTWjebQislThL/4Sv7uIgTgumaDtsZKkEj4IGCGsH1sC5UPvO5R2Hm1qXC8eZ/GOof7MJPJLc/Nl+1sMH1U7e/IPk8+seLgyKP/iGBVEbKs+Pa5XEg3hY2huxc2yY02vYjzBwrgR+wDDy4SQi1yw7Dmet+HQ1yFP9wCtmiZmWoIfb+379dOlRf61jtUEcsiQ84++3q1KzabayjTE7Xuut0AQYMTwa/kVoLGRyIikorz2ELSQbCLqNBKDLpmrfxSan2Az5OOWQrF6Byx+0w9Sf1GxRmUfa1qIZWYzwbdPgvMXFAqEugpy7NvGMQazwaILdaiUu2S6FYZxPLTRp5+ImVAdnoXtxe1LiJfb/N1iXGvzk=
branches:
only:
- master
- auto
notifications:
email: false
matrix:
allow_failures:
- rust: nightly