Skip to content

Commit

Permalink
Auto merge of #263 - cuviper:revamp-ci, r=hauleth
Browse files Browse the repository at this point in the history
Bump rustc to 1.8 and revamp all CI

This bumps the minimum rustc to 1.8.0, "fixing" #257.  I normally
consider this a breaking change, but we were already broken due to
external factors, for which I couldn't find a workaround.

This adds 1.15.0 to the CI matrix to build stable num-derive.  We still
need nightly to run its tests though, because of compiletest_rs, and
dev-dependencies can't be optional.

The testing scripts are moved from .travis/ to ci/, as they don't really
need to be hidden.  It's also now consolidated into one test_full.sh
which considers $TRAVIS_BRANCH as needed.
  • Loading branch information
homu committed Feb 10, 2017
2 parents d561e4b + f58062f commit cd75d87
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 61 deletions.
16 changes: 0 additions & 16 deletions .rustup.sh

This file was deleted.

10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
language: rust
rust:
- 1.0.0
- 1.8.0
- 1.15.0
- beta
- nightly
sudo: false
script:
- cargo build --verbose
- make test
- .travis/test_features.sh
- |
[ $TRAVIS_RUST_VERSION != nightly ] || .travis/test_nightly.sh
- ./ci/test_full.sh
- cargo doc
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = nightly ] &&
ssh-agent .travis/deploy.sh
ssh-agent ./ci/deploy.sh
notifications:
email:
on_success: never
7 changes: 0 additions & 7 deletions .travis/test_features.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .travis/test_nightly.sh

This file was deleted.

14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ and this to your crate root:
```rust
extern crate num;
```

## Compatibility

Most of the `num` crates are tested for rustc 1.8 and greater.
The exceptions are `num-derive` which requires at least rustc 1.15,
and the deprecated `num-macros` which requires nightly rustc.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .travis/deploy.sh → ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cp doc/* target/doc/
pip install ghp-import --user
$HOME/.local/bin/ghp-import -n target/doc

openssl aes-256-cbc -K $encrypted_9e86330b283d_key -iv $encrypted_9e86330b283d_iv -in .travis/deploy.enc -out .travis/deploy -d
chmod 600 .travis/deploy
ssh-add .travis/deploy
openssl aes-256-cbc -K $encrypted_9e86330b283d_key -iv $encrypted_9e86330b283d_iv -in ./ci/deploy.enc -out ./ci/deploy -d
chmod 600 ./ci/deploy
ssh-add ./ci/deploy
git push -qf ssh://git@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
12 changes: 12 additions & 0 deletions ci/rustup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# Use rustup to locally run the same suite of tests as .travis.yml.
# (You should first install/update 1.8.0, 1.15.0, beta, and nightly.)

set -ex

for toolchain in 1.8.0 1.15.0 beta nightly; do
run="rustup run $toolchain"
$run cargo build --verbose
$run $PWD/ci/test_full.sh $toolchain
$run cargo doc
done
43 changes: 43 additions & 0 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -ex

echo Testing num on rustc ${TRAVIS_BRANCH:=$1}

# All of these packages should build and test everywhere.
for package in bigint complex integer iter rational traits; do
cargo build --manifest-path $package/Cargo.toml
cargo test --manifest-path $package/Cargo.toml
done

# Each isolated feature should also work everywhere.
for feature in '' bigint rational complex; do
cargo build --verbose --no-default-features --features="$feature"
cargo test --verbose --no-default-features --features="$feature"
done

# Build test for the serde feature
cargo build --verbose --features "serde"

# Downgrade serde and build test the 0.7.0 channel as well
cargo update -p serde --precise 0.7.0
cargo build --verbose --features "serde"


if [ "$TRAVIS_BRANCH" = 1.8.0 ]; then exit; fi

# num-derive should build on 1.15.0+
cargo build --verbose --manifest-path=derive/Cargo.toml


if [ "$TRAVIS_BRANCH" != nightly ]; then exit; fi

# num-derive testing requires compiletest_rs, which requires nightly
cargo test --verbose --manifest-path=derive/Cargo.toml

# num-macros only works on nightly, soon to be deprecated
cargo build --verbose --manifest-path=macros/Cargo.toml
cargo test --verbose --manifest-path=macros/Cargo.toml

# benchmarks only work on nightly
cargo bench --verbose

0 comments on commit cd75d87

Please sign in to comment.