Skip to content

Commit 4342f72

Browse files
committed
Switch travis to rustup and one build per PR
Like AppVeyor this only schedules one build to run on PRs, and everything else will exit quickly. This'll help keep the queue clear for PRs when they come through. Also switch Travis to using rustup instead of `rustup.sh` manually.
1 parent de6491e commit 4342f72

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

.travis.yml

Lines changed: 17 additions & 22 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
@@ -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)