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