Skip to content

Commit 76fecc5

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 + 3e99a69 commit 76fecc5

File tree

26 files changed

+1128
-747
lines changed

26 files changed

+1128
-747
lines changed

.travis.yml

Lines changed: 25 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,8 @@ 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
18+
ALLOW_PR=1
1619

1720
# Cross builds happen in the `rust-slave-linux-cross` image to ensure that
1821
# we use the right cross compilers for these targets. That image should
@@ -47,31 +50,31 @@ matrix:
4750
SKIP_TESTS=1
4851
- os: linux
4952
env: TARGET=powerpc64-unknown-linux-gnu
50-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
53+
DOCKER=powerpc64-unknown-linux-gnu
5154
SKIP_TESTS=1
5255
- os: linux
5356
env: TARGET=powerpc64le-unknown-linux-gnu
54-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
57+
DOCKER=powerpc64le-unknown-linux-gnu
5558
SKIP_TESTS=1
5659
- os: linux
5760
env: TARGET=mips-unknown-linux-gnu
58-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
61+
DOCKER=mips-unknown-linux-gnu
5962
SKIP_TESTS=1
6063
- os: linux
6164
env: TARGET=mipsel-unknown-linux-gnu
62-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
65+
DOCKER=mipsel-unknown-linux-gnu
6366
SKIP_TESTS=1
6467
- os: linux
6568
env: TARGET=mips64-unknown-linux-gnuabi64
66-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
69+
DOCKER=mips64-unknown-linux-gnuabi64
6770
SKIP_TESTS=1
6871
- os: linux
6972
env: TARGET=mips64el-unknown-linux-gnuabi64
70-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
73+
DOCKER=mips64el-unknown-linux-gnuabi64
7174
SKIP_TESTS=1
7275
- os: linux
7376
env: TARGET=s390x-unknown-linux-gnu
74-
DOCKER=alexcrichton/rust-slave-linux-cross:2016-11-11
77+
DOCKER=s390x-unknown-linux-gnu
7578
SKIP_TESTS=1
7679

7780
# Android use a local docker image
@@ -104,6 +107,7 @@ matrix:
104107
- os: osx
105108
env: TARGET=x86_64-apple-darwin
106109
MACOSX_DEPLOYMENT_TARGET=10.7
110+
NO_ADD=1
107111

108112
cache:
109113
# We're going to download things we don't necessarily want to cache into the `target` directory, so
@@ -118,33 +122,23 @@ branches:
118122
- stable
119123
- auto
120124

121-
notifications:
122-
webhooks: http://buildbot.rust-lang.org/homu/travis
123-
124125
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
126+
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
129127

130128
script:
131-
- mkdir -p target/$TARGET
132-
- if [ ! -z "$DOCKER" ]; then
133-
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
129+
- mkdir -p target/$TARGET;
130+
- >
131+
if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$ALLOW_PR" == "1" ]]; then
132+
if [ ! -z "$DOCKER" ]; then
133+
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
134+
else
135+
PATH=$HOME/rust/bin:$PATH sh ci/run.sh;
136+
fi
134137
else
135-
PATH=$HOME/rust/bin:$PATH sh ci/run.sh;
138+
echo 'skipping build';
136139
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
140+
141+
before_deploy:
148142
- bash ci/prepare-deploy-travis.sh
149143

150144
deploy:
@@ -163,4 +157,6 @@ deploy:
163157

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

0 commit comments

Comments
 (0)