-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
107 lines (95 loc) · 3.33 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
106
107
language: rust
rust:
- stable
- beta
- nightly
sudo: true
os:
- linux
matrix:
allow_failures:
- rust: nightly
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- libiberty-dev
- cmake
before_script:
- |
if [ "${TRAVIS_OS_NAME}" = 'osx' ]; then
export PATH=$HOME/Library/Python/2.7/bin:$PATH
fi
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
pippackage=("ghp-import" "pytoml")
comm -13 <(pip freeze | cut -d= -f1 | sort) <(for i in ${pippackage[*]};do echo $i;done | sort) | grep -v '^#' | xargs pip install --user
export CARGO_PACKAGE_NAME=$(echo 'import pytoml as toml; print(toml.load(open("Cargo.toml", "rb"))["package"]["name"])' | python2)
echo CARGO_PACKAGE_NAME=$CARGO_PACKAGE_NAME
fi
- |
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
export FEATURES="complex rational ndarray use_fpa i128"
else
export FEATURES="complex rational ndarray use_fpa"
fi
- cargo install cargo-update || echo "cargo-update already installed"
- cargo install cargo-travis || echo "cargo-travis already installed"
- cargo install-update -a || true # update outdated cached binaries
script:
- cargo build --features="$FEATURES"
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cargo coveralls --features="$FEATURES" || cargo test --features="$FEATURES"
else
cargo test --features="$FEATURES"
fi
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cargo coveralls --release --features="$FEATURES" || cargo test --release --features="$FEATURES"
else
cargo test --release --features="$FEATURES"
fi
- |
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
cargo bench --verbose --features="$FEATURES"
fi
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cargo doc --no-deps --features="docs" &&
echo "<meta http-equiv=refresh content=0;url=`echo $CARGO_PACKAGE_NAME`/index.html>" > target/doc/index.html &&
ghp-import -n target/doc
fi
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cargo login ${CRATES_TOKEN} &&
cargo package
fi
after_success:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] &&
[ "${TRAVIS_RUST_VERSION}" = "stable" ] &&
[ "${TRAVIS_BRANCH}" = "master" ] &&
[ "${TRAVIS_PULL_REQUEST}" = "false" ] &&
[ "${RUSTFLAGS}"="-C debug-assertions=off" ] &&
[ "${TRAVIS_EVENT_TYPE}" = "push" ]; then
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages &&
cargo publish
fi
env:
matrix:
- RUSTFLAGS="-C debug-assertions=on"
- RUSTFLAGS="-C debug-assertions=off"
global:
secure: qwMSXpdCryGDyfiy1lXEcR/kWhATlQGVNAqV83n9uBKDLP6WsX4C25zMAz1/0wkjiorBMNFGhxMLI956md7V84sLX+6FNfA0tRODtAnJYyjR3AX4RkXB6zFhbTqWg/2BAefJ7Y7Vy0qKLKbqFq6023lKg09Mk80fEReba4PisrMgfj3LCCUarAnxfuFnAB7LmlvWXHNd3w+x6dV8fxO0Zw6QoqB9wQQvQzIiApqWCTyoxQhW+qzo6bXrctPct/OGNhmf4I0l1QJBGPN6qpFrxSjFljbxqIBiagCb6k1WERpok2FiNjhXCowUhTMyaGIlZLaVLjuISu8+aCyHZqK/yQLIDwWm5iY3Ko1gUbhvcg3aQV2ovpN8nxrQaiEkhg8mUPDPG0NencibFItb510L/VK3UkBWgTcKmwMjsqErh/l3a6UvezSAkUHrkMMAGLSrKnveFXeGCTwePLN40NgqJzuKsaSL+gqlTP7dHVtWpsBIvmrK7x4ItwWGRETYQR9HJQbeX+bxQSDJRpkuSTmY1iFL6GF1R0SNRYjXIeZ8Ei8F6O0RqUl7sWjMf9KEWD1LVkWj3X8eM+lTLyNSzP9BGlTP/Q34oJ2LKc4lYj59NE5ai4/rzfz0p8/ANoEJxUJoYgkdl90jw90UltPEjxD7YeCJ8WVhB4tp72qV44RtlDA=
cache:
cargo: true
apt: true
pip: true
notifications:
email:
on_success: never
on_failure: always