Skip to content

Commit 5d56449

Browse files
committed
Update CI for 0.2
1 parent 67ebcad commit 5d56449

File tree

4 files changed

+21
-25
lines changed

4 files changed

+21
-25
lines changed

.travis.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
language: rust
22
rust:
3+
- 1.15.0
4+
- 1.22.0
5+
- 1.26.0
36
- stable
47
- beta
58
- nightly
6-
matrix:
7-
include:
8-
- rust: 1.8.0
9-
before_script:
10-
# rand 0.3.22 started depending on rand 0.4, which requires rustc 1.15
11-
# manually hacking the lockfile due to the limitations of cargo#2773
12-
- cargo generate-lockfile
13-
- sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
14-
- sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
159
sudo: false
1610
script:
1711
- cargo build --verbose

ci/rustup.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
#!/bin/sh
22
# Use rustup to locally run the same suite of tests as .travis.yml.
3-
# (You should first install/update 1.8.0, stable, beta, and nightly.)
3+
# (You should first install/update all versions listed below.)
44

55
set -ex
66

77
export TRAVIS_RUST_VERSION
8-
for TRAVIS_RUST_VERSION in 1.8.0 stable beta nightly; do
8+
for TRAVIS_RUST_VERSION in 1.15.0 1.22.0 1.26.0 stable beta nightly; do
99
run="rustup run $TRAVIS_RUST_VERSION"
10-
if [ "$TRAVIS_RUST_VERSION" = 1.8.0 ]; then
11-
# rand 0.3.22 started depending on rand 0.4, which requires rustc 1.15
12-
# manually hacking the lockfile due to the limitations of cargo#2773
13-
$run cargo generate-lockfile
14-
$run sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
15-
$run sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
16-
fi
1710
$run cargo build --verbose
1811
$run $PWD/ci/test_full.sh
1912
done

ci/test_full.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ set -ex
44

55
echo Testing num on rustc ${TRAVIS_RUST_VERSION}
66

7+
FEATURES="serde"
8+
if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.26.0|1.22.0)$ ]]; then
9+
FEATURES="$FEATURES rand"
10+
fi
11+
if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable|1.26.0)$ ]]; then
12+
FEATURES="$FEATURES i128"
13+
fi
14+
715
# num should build and test everywhere.
816
cargo build --verbose
917
cargo test --verbose
@@ -13,11 +21,12 @@ cargo build --no-default-features
1321
cargo test --no-default-features
1422

1523
# Each isolated feature should also work everywhere.
16-
for feature in bigint complex rational rustc-serialize serde; do
17-
cargo build --verbose --no-default-features --features="$feature"
18-
cargo test --verbose --no-default-features --features="$feature"
24+
# (but still with "std", else bigint breaks)
25+
for feature in $FEATURES; do
26+
cargo build --verbose --no-default-features --features="std $feature"
27+
cargo test --verbose --no-default-features --features="std $feature"
1928
done
2029

21-
# Downgrade serde and build test the 0.7.0 channel as well
22-
cargo update -p serde --precise 0.7.0
23-
cargo build --verbose --features "serde"
30+
# test all supported features together
31+
cargo build --features="std $FEATURES"
32+
cargo test --features="std $FEATURES"

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//!
5656
//! ## Compatibility
5757
//!
58-
//! The `num` crate is tested for rustc 1.8 and greater.
58+
//! The `num` crate is tested for rustc 1.15 and greater.
5959
6060
#![doc(html_root_url = "https://docs.rs/num/0.2")]
6161
#![no_std]

0 commit comments

Comments
 (0)