]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Auto merge of #3518 - sinkuu:redundant_clone_tw, r=phansch
[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
21 before_install:
22  - |
23     # work-around for issue https://github.com/travis-ci/travis-ci/issues/6307
24     # might not be necessary in the future
25     if [ "$TRAVIS_OS_NAME" == "osx" ]; then
26      command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
27      rvm get stable
28     fi
29
30 install:
31   - |
32     if [ -z ${INTEGRATION} ]; then
33       rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
34       if [ "$TRAVIS_OS_NAME" == "linux" ]; then
35         . $HOME/.nvm/nvm.sh
36         nvm install stable
37         nvm use stable
38         npm install remark-cli remark-lint
39       fi
40       if [ "$TRAVIS_OS_NAME" == "windows" ]; then
41         choco install windows-sdk-10.0
42       fi
43     fi
44
45 # disabling the integration tests in forks should be done with
46 # if: fork = false
47 # but this is currently buggy travis-ci/travis-ci#9118
48 matrix:
49   fast_finish: true
50   include:
51     - os: osx # run base tests on both platforms
52       env: BASE_TESTS=true
53     - os: linux
54       env: BASE_TESTS=true
55     - os: windows
56       env: CARGO_INCREMENTAL=0 BASE_TESTS=true
57     - env: INTEGRATION=rust-lang/cargo
58       if: repo =~ /^rust-lang\/rust-clippy$/
59     - env: INTEGRATION=rust-random/rand
60       if: repo =~ /^rust-lang\/rust-clippy$/
61     - env: INTEGRATION=rust-lang-nursery/stdsimd
62       if: repo =~ /^rust-lang\/rust-clippy$/
63     - env: INTEGRATION=rust-lang/rustfmt
64       if: repo =~ /^rust-lang\/rust-clippy$/
65     - env: INTEGRATION=rust-lang-nursery/futures-rs
66       if: repo =~ /^rust-lang\/rust-clippy$/
67     - env: INTEGRATION=rust-lang-nursery/failure
68       if: repo =~ /^rust-lang\/rust-clippy$/
69     - env: INTEGRATION=rust-lang-nursery/log
70       if: repo =~ /^rust-lang\/rust-clippy$/
71     - env: INTEGRATION=rust-lang-nursery/chalk
72       if: repo =~ /^rust-lang\/rust-clippy$/
73     - env: INTEGRATION=rust-lang/rls
74       if: repo =~ /^rust-lang\/rust-clippy$/
75     - env: INTEGRATION=chronotope/chrono
76       if: repo =~ /^rust-lang\/rust-clippy$/
77     - env: INTEGRATION=serde-rs/serde
78       if: repo =~ /^rust-lang\/rust-clippy$/
79     - env: INTEGRATION=Geal/nom
80       if: repo =~ /^rust-lang\/rust-clippy$/
81     - env: INTEGRATION=hyperium/hyper
82       if: repo =~ /^rust-lang\/rust-clippy$/
83   allow_failures:
84   - os: windows
85     env: CARGO_INCREMENTAL=0 BASE_TESTS=true
86 # prevent these jobs with default env vars
87   exclude:
88     - os: linux
89     - os: osx
90     - os: windows
91
92 script:
93   - |
94       rm rust-toolchain
95       cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
96       RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
97       travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH
98       rustup default master
99       export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
100   - |
101     if [ -z ${INTEGRATION} ]; then
102       ./ci/base-tests.sh && sleep 5
103     else
104       ./ci/integration-tests.sh && sleep 5
105     fi
106
107 after_success: |
108   #!/bin/bash
109   if [ $(uname) == Linux ]; then
110     set -ex
111     if [ -z ${INTEGRATION} ]; then
112       ./.github/deploy.sh
113     else
114       echo "Not deploying, because we're in an integration test run"
115     fi
116     set +e
117   fi