.travis.yml 10.1 KB
Newer Older
1
language: shell
A
Alex Crichton 已提交
2
sudo: required
3
dist: trusty
S
Seo Sanghyeon 已提交
4 5
services:
  - docker
6

A
Alex Crichton 已提交
7
git:
8
  depth: 1
9
  submodules: false
10

11
matrix:
A
Alex Crichton 已提交
12
  fast_finish: true
13 14
  include:
    # Linux builders, all docker images
15
    - env: IMAGE=arm-android
16
    - env: IMAGE=armhf-gnu
17
    - env: IMAGE=cross DEPLOY=1
18
    - env: IMAGE=dist-aarch64-linux DEPLOY=1
19
    - env: IMAGE=dist-android DEPLOY=1
20
    - env: IMAGE=dist-arm-linux DEPLOY=1
21 22
    - env: IMAGE=dist-armhf-linux DEPLOY=1
    - env: IMAGE=dist-armv7-linux DEPLOY=1
P
Petr Hosek 已提交
23
    - env: IMAGE=dist-fuchsia DEPLOY=1
24 25 26
    - env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
    - env: IMAGE=dist-i686-freebsd DEPLOY=1
    - env: IMAGE=dist-i686-linux DEPLOY=1
27 28
    - env: IMAGE=dist-mips-linux DEPLOY=1
    - env: IMAGE=dist-mips64-linux DEPLOY=1
29 30
    - env: IMAGE=dist-mips64el-linux DEPLOY=1
    - env: IMAGE=dist-mipsel-linux DEPLOY=1
31 32
    - env: IMAGE=dist-powerpc-linux DEPLOY=1
    - env: IMAGE=dist-powerpc64-linux DEPLOY=1
33 34 35
    - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
    - env: IMAGE=dist-s390x-linux DEPLOY=1
    - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
36
    - env: IMAGE=dist-x86_64-linux DEPLOY=1 ALLOW_TRY=1
37
    - env: IMAGE=dist-x86_64-musl DEPLOY=1
38
    - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
39
    - env: IMAGE=asmjs
40
    - env: IMAGE=i686-gnu
41
    - env: IMAGE=i686-gnu-nopt
M
Marco A L Barbosa 已提交
42
    # - env: IMAGE=wasm32 issue 42646
43
    - env: IMAGE=x86_64-gnu
44
    - env: IMAGE=x86_64-gnu-full-bootstrap
45
    - env: IMAGE=x86_64-gnu-aux
46 47
    - env: IMAGE=x86_64-gnu-debug
    - env: IMAGE=x86_64-gnu-nopt
48
    - env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1 RUST_BACKTRACE=1
A
Alex Crichton 已提交
49
    - env: IMAGE=x86_64-gnu-distcheck
50
    - env: IMAGE=x86_64-gnu-incremental
51

52 53 54 55
    # OSX builders running tests, these run the full test suite.
    #
    # Note that the compiler is compiled to target 10.8 here because the Xcode
    # version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
56 57
    - env: >
        RUST_CHECK_TARGET=check
58
        RUST_CONFIGURE_ARGS="--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler"
59
        SRC=.
60
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
61
        SCCACHE_ERROR_LOG=/tmp/sccache.log
P
Peter Wagenet 已提交
62 63
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
64
      os: osx
65
      osx_image: xcode8.2
A
Alex Crichton 已提交
66
      install: &osx_install_sccache >
67
        travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
68 69 70
          chmod +x /usr/local/bin/sccache &&
        travis_retry curl -o /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
          chmod +x /usr/local/bin/stamp
71 72 73 74
    - env: >
        RUST_CHECK_TARGET=check
        RUST_CONFIGURE_ARGS=--build=i686-apple-darwin
        SRC=.
75
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
76
        SCCACHE_ERROR_LOG=/tmp/sccache.log
P
Peter Wagenet 已提交
77 78
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
79 80 81
      os: osx
      osx_image: xcode8.2
      install: *osx_install_sccache
82

83 84 85 86 87 88
    # OSX builders producing releases. These do not run the full test suite and
    # just produce a bunch of artifacts.
    #
    # Note that these are running in the `xcode7` image instead of the
    # `xcode8.2` image as above. That's because we want to build releases for
    # OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7.
89
    - env: >
90
        RUST_CHECK_TARGET=dist
91
        RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-extended --enable-profiler"
92
        SRC=.
93
        DEPLOY=1
94
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
95
        SCCACHE_ERROR_LOG=/tmp/sccache.log
96
        MACOSX_DEPLOYMENT_TARGET=10.7
97
      os: osx
98
      osx_image: xcode7
A
Andrea Canciani 已提交
99
      install:
100 101
        - travis_retry brew update
        - travis_retry brew install xz
A
Andrea Canciani 已提交
102
        - *osx_install_sccache
103
    - env: >
104
        RUST_CHECK_TARGET=dist
105
        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"
106
        SRC=.
107
        DEPLOY=1
108
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
109
        SCCACHE_ERROR_LOG=/tmp/sccache.log
110
        MACOSX_DEPLOYMENT_TARGET=10.7
111
      os: osx
112
      osx_image: xcode7
A
Andrea Canciani 已提交
113
      install:
114 115
        - travis_retry brew update
        - travis_retry brew install xz
A
Andrea Canciani 已提交
116
        - *osx_install_sccache
A
Alex Crichton 已提交
117

118 119 120 121
    # "alternate" deployments, these are "nightlies" but don't have assertions
    # turned on, they're deployed to a different location primarily for projects
    # which are stuck on nightly and don't want llvm assertions in the artifacts
    # that they use.
T
Tim Neumann 已提交
122
    - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
123 124
    - env: >
        RUST_CHECK_TARGET=dist
125
        RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
126 127
        SRC=.
        DEPLOY_ALT=1
128
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
129
        SCCACHE_ERROR_LOG=/tmp/sccache.log
130
        MACOSX_DEPLOYMENT_TARGET=10.7
131
      os: osx
132
      osx_image: xcode7
A
Andrea Canciani 已提交
133
      install:
134 135
        - travis_retry brew update
        - travis_retry brew install xz
A
Andrea Canciani 已提交
136
        - *osx_install_sccache
137

A
Alex Crichton 已提交
138 139 140 141 142 143
env:
  global:
    - SCCACHE_BUCKET=rust-lang-ci-sccache
    - AWS_ACCESS_KEY_ID=AKIAIMX7VLAS3PZAVLUQ
    # AWS_SECRET_ACCESS_KEY=...
    - secure: "Pixhh0hXDqGCdOyLtGFjli3J2AtDWIpyb2btIrLe956nCBDRutRoMm6rv5DI9sFZN07Mms7VzNNvhc9wCW1y63JAm414d2Co7Ob8kWMZlz9l9t7ACHuktUiis8yr+S4Quq1Vqd6pqi7pf2J++UxC8R/uLeqVrubzr6+X7AbmEFE="
A
arcnmx 已提交
144

145 146
# Note that this is overridden on OSX builders
install: >
A
Alex Crichton 已提交
147 148 149
  travis_retry curl -o $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
    chmod +x $HOME/stamp &&
    export PATH=$PATH:$HOME
150

151 152 153 154 155
before_script:
  - >
      echo "#### Disk usage before running script:";
      df -h;
      du . | sort -nr | head -n100
156 157
  # If we are building a pull request, do the build if $ALLOW_PR == 1
  # Otherwise, do the build if we are on the auto branch, or the try branch and $ALLOW_TRY == 1
158
  - >
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
      if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
          if [[ "$ALLOW_PR" == "1" ]]; then
              SKIP_BUILD=false;
          else
              SKIP_BUILD=true;
          fi
      elif [[ "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" == "1" && "$TRAVIS_BRANCH" == "try" ) ]]; then
          SKIP_BUILD=false;
      else
          SKIP_BUILD=true;
      fi

      if [[ "$SKIP_BUILD" == true ]]; then
          export RUN_SCRIPT="echo 'skipping, not a full build'";
      else
174
          RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
175
          if [ "$TRAVIS_OS_NAME" = "osx" ]; then
176
              export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
177
          else
178
              export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
179
          fi
180
      fi
181

182 183
# Log time information from this machine and an external machine for insight into possible
# clock drift. Timezones don't matter since relative deltas give all the necessary info.
184
script:
185 186
  - >
      date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
187
  - stamp sh -x -c "$RUN_SCRIPT"
188 189
  - >
      date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
190

191 192 193 194 195 196 197 198 199 200 201
after_success:
  - >
      echo "#### Build successful; Disk usage after running script:";
      df -h;
      du . | sort -nr | head -n100

after_failure:
  - >
      echo "#### Build failed; Disk usage after running script:";
      df -h;
      du . | sort -nr | head -n100
202 203 204 205

  # One of these is the linux sccache log, one is the OSX sccache log. Instead
  # of worrying about what system we are just cat both. One of these commands
  # will fail but that's ok, they'll both get executed.
206
  - cat obj/tmp/sccache.log
207
  - cat /tmp/sccache.log
208

209 210 211 212
  # Random attempt at debugging currently. Just poking around in here to see if
  # anything shows up.
  - ls $HOME/Library/Logs/DiagnosticReports/

213 214 215 216
  # attempt to debug anything killed by the oom killer on linux, just to see if
  # it happened
  - dmesg | grep -i kill

217
# Save tagged docker images we created and load them if they're available
218
# Travis saves caches whether the build failed or not, nuke rustsrc if
A
acdenisSK 已提交
219
# the failure was while updating it (as it may be in a bad state)
220
# https://github.com/travis-ci/travis-ci/issues/4472
221 222 223 224
before_cache:
  - docker history -q rust-ci |
    grep -v missing |
    xargs docker save |
A
Alex Crichton 已提交
225
    gzip > $HOME/docker/rust-ci.tar.gz
226 227
before_install:
  - zcat $HOME/docker/rust-ci.tar.gz | docker load || true
228
  - mkdir -p $HOME/rustsrc
M
Matthew Astley 已提交
229

230 231 232
notifications:
  email: false

233 234 235
cache:
  directories:
    - $HOME/docker
236 237 238 239 240

before_deploy:
  - mkdir -p deploy/$TRAVIS_COMMIT
  - >
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
241
          rm -rf build/dist/doc &&
A
Alex Crichton 已提交
242
          cp -r build/dist/* deploy/$TRAVIS_COMMIT;
243
      else
244
          rm -rf obj/build/dist/doc &&
A
Alex Crichton 已提交
245
          cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
      fi

deploy:
  - provider: s3
    bucket: rust-lang-ci
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds
    acl: public_read
    region: us-east-1
    access_key_id: AKIAIPQVNYF2T3DTYIWQ
    secret_access_key:
      secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
    on:
      branch: auto
      condition: $DEPLOY = 1
262

263 264 265 266 267 268 269 270 271 272 273 274 275 276
  - provider: s3
    bucket: rust-lang-ci
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds-try
    acl: public_read
    region: us-east-1
    access_key_id: AKIAIPQVNYF2T3DTYIWQ
    secret_access_key:
      secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
    on:
      branch: try
      condition: $DEPLOY = 1 && $ALLOW_TRY = 1

277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
  # this is the same as the above deployment provider except that it uploads to
  # a slightly different directory and has a different trigger
  - provider: s3
    bucket: rust-lang-ci
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds-alt
    acl: public_read
    region: us-east-1
    access_key_id: AKIAIPQVNYF2T3DTYIWQ
    secret_access_key:
      secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
    on:
      branch: auto
      condition: $DEPLOY_ALT = 1