]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Rollup merge of #44372 - bgermann:master, r=alexcrichton
[rust.git] / .travis.yml
1 language: shell
2 sudo: required
3 dist: trusty
4 # FIXME(#44398) shouldn't need to be here
5 group: deprecated-2017Q3
6 services:
7   - docker
8
9 git:
10   depth: 1
11   submodules: false
12
13 matrix:
14   fast_finish: true
15   include:
16     # Images used in testing PR and try-build should be run first.
17     - env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1 RUST_BACKTRACE=1
18     - env: IMAGE=dist-x86_64-linux DEPLOY=1 ALLOW_TRY=1
19
20     # "alternate" deployments, these are "nightlies" but don't have assertions
21     # turned on, they're deployed to a different location primarily for projects
22     # which are stuck on nightly and don't want llvm assertions in the artifacts
23     # that they use.
24     - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
25     - env: >
26         RUST_CHECK_TARGET=dist
27         RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
28         SRC=.
29         DEPLOY_ALT=1
30         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
31         SCCACHE_ERROR_LOG=/tmp/sccache.log
32         MACOSX_DEPLOYMENT_TARGET=10.7
33       os: osx
34       osx_image: xcode7
35
36     # macOS builders. These are placed near the beginning because they are very
37     # slow to run.
38
39     # OSX builders running tests, these run the full test suite.
40     #
41     # Note that the compiler is compiled to target 10.8 here because the Xcode
42     # version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
43     - env: >
44         RUST_CHECK_TARGET=check
45         RUST_CONFIGURE_ARGS="--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler"
46         SRC=.
47         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
48         SCCACHE_ERROR_LOG=/tmp/sccache.log
49         MACOSX_DEPLOYMENT_TARGET=10.8
50         MACOSX_STD_DEPLOYMENT_TARGET=10.7
51       os: osx
52       osx_image: xcode8.2
53     - env: >
54         RUST_CHECK_TARGET=check
55         RUST_CONFIGURE_ARGS=--build=i686-apple-darwin
56         SRC=.
57         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
58         SCCACHE_ERROR_LOG=/tmp/sccache.log
59         MACOSX_DEPLOYMENT_TARGET=10.8
60         MACOSX_STD_DEPLOYMENT_TARGET=10.7
61       os: osx
62       osx_image: xcode8.2
63
64     # OSX builders producing releases. These do not run the full test suite and
65     # just produce a bunch of artifacts.
66     #
67     # Note that these are running in the `xcode7` image instead of the
68     # `xcode8.2` image as above. That's because we want to build releases for
69     # OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7.
70     - env: >
71         RUST_CHECK_TARGET=dist
72         RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-extended --enable-profiler"
73         SRC=.
74         DEPLOY=1
75         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
76         SCCACHE_ERROR_LOG=/tmp/sccache.log
77         MACOSX_DEPLOYMENT_TARGET=10.7
78       os: osx
79       osx_image: xcode7
80     - env: >
81         RUST_CHECK_TARGET=dist
82         RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended --enable-sanitizers --enable-profiler"
83         SRC=.
84         DEPLOY=1
85         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
86         SCCACHE_ERROR_LOG=/tmp/sccache.log
87         MACOSX_DEPLOYMENT_TARGET=10.7
88       os: osx
89       osx_image: xcode7
90
91     # Linux builders, remaining docker images
92     - env: IMAGE=arm-android
93     - env: IMAGE=armhf-gnu
94     - env: IMAGE=cross DEPLOY=1
95     - env: IMAGE=dist-aarch64-linux DEPLOY=1
96     - env: IMAGE=dist-android DEPLOY=1
97     - env: IMAGE=dist-arm-linux DEPLOY=1
98     - env: IMAGE=dist-armhf-linux DEPLOY=1
99     - env: IMAGE=dist-armv7-linux DEPLOY=1
100     - env: IMAGE=dist-fuchsia DEPLOY=1
101     - env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
102     - env: IMAGE=dist-i686-freebsd DEPLOY=1
103     - env: IMAGE=dist-i686-linux DEPLOY=1
104     - env: IMAGE=dist-mips-linux DEPLOY=1
105     - env: IMAGE=dist-mips64-linux DEPLOY=1
106     - env: IMAGE=dist-mips64el-linux DEPLOY=1
107     - env: IMAGE=dist-mipsel-linux DEPLOY=1
108     - env: IMAGE=dist-powerpc-linux DEPLOY=1
109     - env: IMAGE=dist-powerpc64-linux DEPLOY=1
110     - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
111     - env: IMAGE=dist-s390x-linux DEPLOY=1
112     - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
113     - env: IMAGE=dist-x86_64-musl DEPLOY=1
114     - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
115     - env: IMAGE=asmjs
116     - env: IMAGE=i686-gnu
117     - env: IMAGE=i686-gnu-nopt
118     # - env: IMAGE=wasm32 issue 42646
119     - env: IMAGE=x86_64-gnu
120     - env: IMAGE=x86_64-gnu-full-bootstrap
121     - env: IMAGE=x86_64-gnu-aux
122     - env: IMAGE=x86_64-gnu-debug
123     - env: IMAGE=x86_64-gnu-nopt
124     - env: IMAGE=x86_64-gnu-distcheck
125     - env: IMAGE=x86_64-gnu-incremental
126
127 env:
128   global:
129     - SCCACHE_BUCKET=rust-lang-ci-sccache
130     - AWS_ACCESS_KEY_ID=AKIAIMX7VLAS3PZAVLUQ
131     # AWS_SECRET_ACCESS_KEY=...
132     - secure: "Pixhh0hXDqGCdOyLtGFjli3J2AtDWIpyb2btIrLe956nCBDRutRoMm6rv5DI9sFZN07Mms7VzNNvhc9wCW1y63JAm414d2Co7Ob8kWMZlz9l9t7ACHuktUiis8yr+S4Quq1Vqd6pqi7pf2J++UxC8R/uLeqVrubzr6+X7AbmEFE="
133
134 before_install:
135   # If we are building a pull request, do the build if $ALLOW_PR == 1
136   # Otherwise, do the build if we are on the auto branch, or the try branch and $ALLOW_TRY == 1
137   - >
138     if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
139         if [[ "$ALLOW_PR" == "1" ]]; then
140             export SKIP_BUILD=false;
141         else
142             export SKIP_BUILD=true;
143         fi;
144     elif [[ "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" == "1" && "$TRAVIS_BRANCH" == "try" ) ]]; then
145         export SKIP_BUILD=false;
146     else
147         export SKIP_BUILD=true;
148     fi
149   - >
150     if [[ "$SKIP_BUILD" == false ]]; then
151       zcat $HOME/docker/rust-ci.tar.gz | docker load || true
152     fi
153   - mkdir -p $HOME/rustsrc
154
155 install:
156   - >
157     if [[ "$SKIP_BUILD" == true ]]; then
158       echo echo skipping, not a full build > $HOME/stamp &&
159         chmod +x $HOME/stamp &&
160         export PATH=$PATH:$HOME;
161     else
162       case "$TRAVIS_OS_NAME" in
163         linux)
164           travis_retry curl -fo $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
165             chmod +x $HOME/stamp &&
166             export PATH=$PATH:$HOME
167           ;;
168         osx)
169           if [[ "$RUST_CHECK_TARGET" == dist ]]; then
170             travis_retry brew update &&
171             travis_retry brew install xz;
172           fi &&
173           travis_retry curl -fo /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
174             chmod +x /usr/local/bin/sccache &&
175           travis_retry curl -fo /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
176             chmod +x /usr/local/bin/stamp
177           ;;
178       esac
179     fi
180
181 before_script:
182   - >
183       echo "#### Disk usage before running script:";
184       df -h;
185       du . | sort -nr | head -n100
186   - >
187       RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
188       if [ "$TRAVIS_OS_NAME" = "osx" ]; then
189           export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
190       else
191           export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
192       fi
193
194 # Log time information from this machine and an external machine for insight into possible
195 # clock drift. Timezones don't matter since relative deltas give all the necessary info.
196 script:
197   - >
198       date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
199   - stamp sh -x -c "$RUN_SCRIPT"
200   - >
201       date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
202
203 after_success:
204   - >
205       echo "#### Build successful; Disk usage after running script:";
206       df -h;
207       du . | sort -nr | head -n100
208
209 after_failure:
210   - >
211       echo "#### Build failed; Disk usage after running script:";
212       df -h;
213       du . | sort -nr | head -n100
214
215   # One of these is the linux sccache log, one is the OSX sccache log. Instead
216   # of worrying about what system we are just cat both. One of these commands
217   # will fail but that's ok, they'll both get executed.
218   - cat obj/tmp/sccache.log
219   - cat /tmp/sccache.log
220
221   # Random attempt at debugging currently. Just poking around in here to see if
222   # anything shows up.
223   - ls $HOME/Library/Logs/DiagnosticReports/
224
225   # attempt to debug anything killed by the oom killer on linux, just to see if
226   # it happened
227   - dmesg | grep -i kill
228
229 # Save tagged docker images we created and load them if they're available
230 # Travis saves caches whether the build failed or not, nuke rustsrc if
231 # the failure was while updating it (as it may be in a bad state)
232 # https://github.com/travis-ci/travis-ci/issues/4472
233 before_cache:
234   - docker history -q rust-ci |
235     grep -v missing |
236     xargs docker save |
237     gzip > $HOME/docker/rust-ci.tar.gz
238
239 notifications:
240   email: false
241
242 cache:
243   directories:
244     - $HOME/docker
245
246 before_deploy:
247   - mkdir -p deploy/$TRAVIS_COMMIT
248   - >
249       if [ "$TRAVIS_OS_NAME" == "osx" ]; then
250           rm -rf build/dist/doc &&
251           cp -r build/dist/* deploy/$TRAVIS_COMMIT;
252       else
253           rm -rf obj/build/dist/doc &&
254           cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
255       fi
256
257 deploy:
258   - provider: s3
259     bucket: rust-lang-ci
260     skip_cleanup: true
261     local_dir: deploy
262     upload_dir: rustc-builds
263     acl: public_read
264     region: us-east-1
265     access_key_id: AKIAIPQVNYF2T3DTYIWQ
266     secret_access_key:
267       secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
268     on:
269       branch: auto
270       condition: $DEPLOY = 1
271
272   - provider: s3
273     bucket: rust-lang-ci
274     skip_cleanup: true
275     local_dir: deploy
276     upload_dir: rustc-builds-try
277     acl: public_read
278     region: us-east-1
279     access_key_id: AKIAIPQVNYF2T3DTYIWQ
280     secret_access_key:
281       secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
282     on:
283       branch: try
284       condition: $DEPLOY = 1 && $ALLOW_TRY = 1
285
286   # this is the same as the above deployment provider except that it uploads to
287   # a slightly different directory and has a different trigger
288   - provider: s3
289     bucket: rust-lang-ci
290     skip_cleanup: true
291     local_dir: deploy
292     upload_dir: rustc-builds-alt
293     acl: public_read
294     region: us-east-1
295     access_key_id: AKIAIPQVNYF2T3DTYIWQ
296     secret_access_key:
297       secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
298     on:
299       branch: auto
300       condition: $DEPLOY_ALT = 1