Skip to content

Commit e04b84e

Browse files
committed
Auto merge of #1230 - alexcrichton:more-fast, r=alexcrichton
Compile less executables in tests Refactor a bit with more aggressive caching to compile at most one Rust program when testing.
2 parents b39a87c + 65aea18 commit e04b84e

File tree

26 files changed

+1127
-747
lines changed

26 files changed

+1127
-747
lines changed

.travis.yml

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: required
22
dist: trusty
33
services:
44
- docker
5+
language: rust
56

67
matrix:
78
include:
@@ -13,6 +14,7 @@ matrix:
1314
- os: linux
1415
env: TARGET=x86_64-unknown-linux-gnu
1516
DOCKER=alexcrichton/rust-slave-dist:2015-10-20b
17+
NO_ADD=1
1618

1719
# Cross builds happen in the `rust-slave-linux-cross` image to ensure that
1820
# we use the right cross compilers for these targets. That image should
@@ -47,31 +49,31 @@ matrix:
4749
SKIP_TESTS=1
4850
- os: linux
4951
env: TARGET=powerpc64-unknown-linux-gnu
50-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
52+
DOCKER=powerpc64-unknown-linux-gnu
5153
SKIP_TESTS=1
5254
- os: linux
5355
env: TARGET=powerpc64le-unknown-linux-gnu
54-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
56+
DOCKER=powerpc64le-unknown-linux-gnu
5557
SKIP_TESTS=1
5658
- os: linux
5759
env: TARGET=mips-unknown-linux-gnu
58-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
60+
DOCKER=mips-unknown-linux-gnu
5961
SKIP_TESTS=1
6062
- os: linux
6163
env: TARGET=mipsel-unknown-linux-gnu
62-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
64+
DOCKER=mipsel-unknown-linux-gnu
6365
SKIP_TESTS=1
6466
- os: linux
6567
env: TARGET=mips64-unknown-linux-gnuabi64
66-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
68+
DOCKER=mips64-unknown-linux-gnuabi64
6769
SKIP_TESTS=1
6870
- os: linux
6971
env: TARGET=mips64el-unknown-linux-gnuabi64
70-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
72+
DOCKER=mips64el-unknown-linux-gnuabi64
7173
SKIP_TESTS=1
7274
- os: linux
7375
env: TARGET=s390x-unknown-linux-gnu
74-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
76+
DOCKER=s390x-unknown-linux-gnu
7577
SKIP_TESTS=1
7678

7779
# Android use a local docker image
@@ -104,6 +106,7 @@ matrix:
104106
- os: osx
105107
env: TARGET=x86_64-apple-darwin
106108
MACOSX_DEPLOYMENT_TARGET=10.7
109+
NO_ADD=1
107110

108111
cache:
109112
# We're going to download things we don't necessarily want to cache into the `target` directory, so
@@ -118,33 +121,23 @@ branches:
118121
- stable
119122
- auto
120123

121-
notifications:
122-
webhooks: http://buildbot.rust-lang.org/homu/travis
123-
124124
install:
125-
- sudo pip install awscli
126-
- aws configure set preview.cloudfront true
127-
- curl https://static.rust-lang.org/rustup.sh |
128-
sh -s -- --prefix=$HOME/rust --spec=nightly-2017-04-25 --with-target=$TARGET
125+
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
129126

130127
script:
131-
- mkdir -p target/$TARGET
132-
- if [ ! -z "$DOCKER" ]; then
133-
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
128+
- mkdir -p target/$TARGET;
129+
- >
130+
if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$ALLOW_PR" == "1" ]]; then
131+
if [ ! -z "$DOCKER" ]; then
132+
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
133+
else
134+
PATH=$HOME/rust/bin:$PATH sh ci/run.sh;
135+
fi
134136
else
135-
PATH=$HOME/rust/bin:$PATH sh ci/run.sh;
137+
echo 'skipping build';
136138
fi
137-
# Install kcov dependencies
138-
# FIXME: busted!
139-
#- if [ "$TARGET" == "x86_64-unknown-linux-gnu" ]; then
140-
# wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz;
141-
# tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make;
142-
# sudo make install && cd ../..;
143-
# echo "Uploading coverage... $TRAVIS_JOB_ID";
144-
# find target/debug/deps/*-* -executable -exec kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov '{}' \;;
145-
# find target/debug/*-* -executable ! -name rustup-rs -exec kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov '{}' \;;
146-
# fi
147-
# prepare for a deploy if this will be a deployment
139+
140+
before_deploy:
148141
- bash ci/prepare-deploy-travis.sh
149142

150143
deploy:
@@ -163,4 +156,6 @@ deploy:
163156

164157
# FIXME: I don't know if this really works
165158
after_deploy:
159+
- sudo pip install awscli
160+
- aws configure set preview.cloudfront true
166161
- aws cloudfront create-invalidation --paths "rustup/$TARGET/* rustup/dev/$TARGET/* rustup/www/* rustup/dev/www/* rustup/* rustup/dev/*"

0 commit comments

Comments
 (0)