Skip to content

Commit

Permalink
Modify travis.yml for cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
chalharu committed Mar 22, 2018
1 parent 68ea121 commit 9181a99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
23 changes: 9 additions & 14 deletions .travis.yml
Expand Up @@ -5,7 +5,7 @@ rust:
- beta
- nightly

sudo: false
sudo: true

os:
- linux
Expand All @@ -22,23 +22,13 @@ addons:
- 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
cargo install cargo-kcov
if [ ! -x $HOME/.cargo/bin/kcov ] || [ ! -f $HOME/.cargo/bin/kcov ]; then
mkdir kcov
cd kcov
cargo kcov --print-install-kcov-sh | sh
cd ${TRAVIS_BUILD_DIR}
rm -rf kcov
fi
fi
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
pippackage=("ghp-import" "pytoml")
Expand All @@ -52,6 +42,9 @@ before_script:
else
export FEATURES="complex rational ndarray"
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"
Expand All @@ -60,7 +53,8 @@ script:
- cargo test --release --no-run --features="$FEATURES"
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cargo kcov --coveralls --features="$FEATURES"
cargo coveralls --features="$FEATURES" ||
cargo test --features="$FEATURES"
else
cargo test --features="$FEATURES"
fi
Expand All @@ -87,7 +81,8 @@ after_success:
[ "${TRAVIS_RUST_VERSION}" = "stable" ] &&
[ "${TRAVIS_BRANCH}" = "master" ] &&
[ "${TRAVIS_PULL_REQUEST}" = "false" ] &&
[ "${RUSTFLAGS}"="-C debug-assertions=off" ]; then
[ "${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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "appro-eq"
version = "0.2.0"
version = "0.2.1"
authors = ["Mitsuharu Seki <mitsu1986@gmail.com>"]
repository = "https://github.com/chalharu/rust-appro-eq"
keywords = ["assert", "array"]
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Expand Up @@ -278,7 +278,7 @@ impl Tolerance for f32 {
#[cfg_attr(feature = "docs", stable(feature = "default", since = "0.1.0"))]
impl AbsError for f32 {
fn abs_error(&self, expected: &f32) -> ApproEqResult<f32> {
Ok(Some(((self - expected).abs())))
Ok(Some((self - expected).abs()))
}
}

Expand Down Expand Up @@ -322,7 +322,7 @@ impl RelError for f64 {
#[cfg_attr(feature = "docs", stable(feature = "default", since = "0.1.0"))]
impl AbsError<f64, f32> for f32 {
fn abs_error(&self, expected: &f64) -> ApproEqResult<f32> {
Ok(Some(((*self as f64 - expected).abs() as f32)))
Ok(Some((*self as f64 - expected).abs() as f32))
}
}

Expand All @@ -340,7 +340,7 @@ impl RelError<f64, f32> for f32 {
#[cfg_attr(feature = "docs", stable(feature = "default", since = "0.1.0"))]
impl AbsError<f32, f32> for f64 {
fn abs_error(&self, expected: &f32) -> ApproEqResult<f32> {
Ok(Some(((self - *expected as f64).abs() as f32)))
Ok(Some((self - *expected as f64).abs() as f32))
}
}

Expand Down

0 comments on commit 9181a99

Please sign in to comment.