]> git.lizzy.rs Git - rust.git/blob - .travis.yml
allow osx failures
[rust.git] / .travis.yml
1 language: rust
2
3 rust: nightly
4
5 os:
6   - linux
7   - osx
8   - windows
9
10 branches:
11   # Don't build these branches
12   except:
13     # Used by bors
14     - trying.tmp
15     - staging.tmp
16
17 env:
18  global:
19    - RUST_BACKTRACE=1
20    - secure: "OKulfkA5OGd/d1IhvBKzRkHQwMcWjzrzbimo7+5NhkUkWxndAzl+719TB3wWvIh1i2wXXrEXsyZkXM5FtRrHm55v1VKQ5ibjEvFg1w3NIg81iDyoLq186fLqywvxGkOAFPrsePPsBj5USd5xvhwwbrjO6L7/RK6Z8shBwOSc41s="
21
22 install:
23   - |
24     if [ -z ${INTEGRATION} ]; then
25       rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
26       if [ "$TRAVIS_OS_NAME" == "linux" ]; then
27         . $HOME/.nvm/nvm.sh
28         nvm install stable
29         nvm use stable
30         npm install remark-cli remark-lint
31       fi
32       if [ "$TRAVIS_OS_NAME" == "windows" ]; then
33         choco install windows-sdk-10.0
34       fi
35     fi
36
37 # disabling the integration tests in forks should be done with
38 # if: fork = false
39 # but this is currently buggy travis-ci/travis-ci#9118
40 matrix:
41   fast_finish: true
42   include:
43     # Builds that are executed for every PR
44     - os: osx # run base tests on both platforms
45       env: BASE_TESTS=true
46     - os: linux
47       env: BASE_TESTS=true
48     - os: windows
49       env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
50
51     # Builds that are only executed when a PR is r+ed or a try build is started
52     # We don't want to run these always because they go towards
53     # the build limit within the Travis rust-lang account.
54     # The jobs are approximately sorted by execution time
55     - env: INTEGRATION=rust-lang/cargo
56       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
57     - env: INTEGRATION=rust-lang-nursery/chalk
58       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
59     # - env: INTEGRATION=rust-lang/rls
60     #   if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
61     - env: INTEGRATION=Geal/nom
62       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
63     - env: INTEGRATION=rust-lang/rustfmt
64       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
65     - env: INTEGRATION=hyperium/hyper
66       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
67     - env: INTEGRATION=bluss/rust-itertools
68       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
69     - env: INTEGRATION=serde-rs/serde
70       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
71     - env: INTEGRATION=rust-lang-nursery/stdsimd
72       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
73     - env: INTEGRATION=rust-random/rand
74       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
75     - env: INTEGRATION=rust-lang-nursery/futures-rs
76       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
77     - env: INTEGRATION=Marwes/combine
78       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
79     - env: INTEGRATION=rust-lang-nursery/failure
80       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
81     - env: INTEGRATION=rust-lang-nursery/log
82       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
83     - env: INTEGRATION=chronotope/chrono
84       if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
85   allow_failures:
86     - os: windows
87       env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
88     - os: osx # run base tests on both platforms
89       env: BASE_TESTS=true
90   # prevent these jobs with default env vars
91   exclude:
92     - os: linux
93     - os: osx
94     - os: windows
95
96 script:
97   - |
98     if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then
99       pr=$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g')
100       output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr" | \
101         python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
102         grep "^changelog: " | \
103         sed "s/changelog: //g")
104       if [ -z "$output" ]; then
105         echo "ERROR: PR body must contain 'changelog: ...'"
106         exit 1
107       elif [ "$output" = "none" ]; then
108         echo "WARNING: changelog is 'none'"
109       fi
110     fi
111   - |
112       rm rust-toolchain
113       ./setup-toolchain.sh
114       if [ "$TRAVIS_OS_NAME" == "windows" ]; then
115         export PATH=$PATH:$(rustc --print sysroot)/bin
116       else
117         export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
118       fi
119   - |
120     if [ -z ${INTEGRATION} ]; then
121       travis_wait 30 ./ci/base-tests.sh && sleep 5
122     else
123       ./ci/integration-tests.sh && sleep 5
124     fi
125
126 after_success: |
127   #!/bin/bash
128   if [ "$TRAVIS_OS_NAME" == "linux" ]; then
129     set -ex
130     if [ -z ${INTEGRATION} ]; then
131       ./.github/deploy.sh
132     else
133       echo "Not deploying, because we're in an integration test run"
134     fi
135     set +e
136   fi