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