]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Merge pull request #3465 from flip1995/rustfmt
[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-preview || 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   include:
50     - os: osx # run base tests on both platforms
51       env: BASE_TESTS=true
52     - os: linux
53       env: BASE_TESTS=true
54     - os: windows
55       env: BASE_TESTS=true
56     - env: INTEGRATION=rust-lang/cargo
57       if: repo =~ /^rust-lang\/rust-clippy$/
58     - env: INTEGRATION=rust-random/rand
59       if: repo =~ /^rust-lang\/rust-clippy$/
60     - env: INTEGRATION=rust-lang-nursery/stdsimd
61       if: repo =~ /^rust-lang\/rust-clippy$/
62     - env: INTEGRATION=rust-lang/rustfmt
63       if: repo =~ /^rust-lang\/rust-clippy$/
64     - env: INTEGRATION=rust-lang-nursery/futures-rs
65       if: repo =~ /^rust-lang\/rust-clippy$/
66     - env: INTEGRATION=rust-lang-nursery/failure
67       if: repo =~ /^rust-lang\/rust-clippy$/
68     - env: INTEGRATION=rust-lang-nursery/log
69       if: repo =~ /^rust-lang\/rust-clippy$/
70     - env: INTEGRATION=rust-lang-nursery/chalk
71       if: repo =~ /^rust-lang\/rust-clippy$/
72     - env: INTEGRATION=rust-lang/rls
73       if: repo =~ /^rust-lang\/rust-clippy$/
74     - env: INTEGRATION=chronotope/chrono
75       if: repo =~ /^rust-lang\/rust-clippy$/
76     - env: INTEGRATION=serde-rs/serde
77       if: repo =~ /^rust-lang\/rust-clippy$/
78     - env: INTEGRATION=Geal/nom
79       if: repo =~ /^rust-lang\/rust-clippy$/
80     - env: INTEGRATION=hyperium/hyper
81       if: repo =~ /^rust-lang\/rust-clippy$/
82   allow_failures:
83   - os: windows
84     env: BASE_TESTS=true
85 # prevent these jobs with default env vars
86   exclude:
87     - os: linux
88     - os: osx
89     - os: windows
90
91 script:
92   - |
93       rm rust-toolchain
94       cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
95       RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
96       travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH
97       rustup default master
98       export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
99   - |
100     if [ -z ${INTEGRATION} ]; then
101       ./ci/base-tests.sh && sleep 5
102     else
103       ./ci/integration-tests.sh && sleep 5
104     fi
105
106 after_success: |
107   #!/bin/bash
108   if [ $(uname) == Linux ]; then
109     set -ex
110     if [ -z ${INTEGRATION} ]; then
111       ./.github/deploy.sh
112     else
113       echo "Not deploying, because we're in an integration test run"
114     fi
115     set +e
116   fi