]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Fix build
[rust.git] / .travis.yml
1 language: rust
2
3 rust: nightly
4
5 os:
6   - linux
7   - osx
8
9 sudo: false
10
11 env:
12  global:
13    # TRAVIS_TOKEN_CLIPPY_SERVICE
14    - secure: dj8SwwuRGuzbo2wZq5z7qXIf7P3p7cbSGs1I3pvXQmB6a58gkLiRn/qBcIIegdt/nzXs+Z0Nug+DdesYVeUPxk1hIa/eeU8p6mpyTtZ+30H4QVgVzd0VCthB5F/NUiPVxTgpGpEgCM9/p72xMwTn7AAJfsGqk7AJ4FS5ZZKhqFI=
15    - RUST_BACKTRACE=1
16
17 before_install:
18  - |
19     # work-around for issue https://github.com/travis-ci/travis-ci/issues/6307
20     # might not be necessary in the future
21     if [ "$TRAVIS_OS_NAME" == "osx" ]; then
22      command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
23      rvm get stable
24     fi
25
26 install:
27   - . $HOME/.nvm/nvm.sh
28   - nvm install stable
29   - nvm use stable
30   - npm install remark-cli remark-lint
31
32 script:
33  - PATH=$PATH:./node_modules/.bin
34  - remark -f README.md > /dev/null
35  - set -e
36  - cargo build --features debugging
37  - cargo test --features debugging
38  - mkdir -p ~/rust/cargo/bin
39  - cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy
40  - cp target/debug/clippy-driver ~/rust/cargo/bin/clippy-driver
41  - PATH=$PATH:~/rust/cargo/bin cargo clippy --all -- -D clippy
42  - cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
43  - cd clippy_workspace_tests/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../..
44  - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../..
45  - cd clippy_workspace_tests/subcrate/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../../..
46  - PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy
47  - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=../Cargo.toml -- -D clippy && cd ../..
48  - set +e
49
50 after_success: |
51   #!/bin/bash
52   if [ $(uname) == Linux ]; then
53     ./.github/deploy.sh
54   # trigger rebuild of the clippy-service, to keep it up to date with clippy itself
55     set -e
56     if [ "$TRAVIS_PULL_REQUEST" == "false" ] &&
57        [ "$TRAVIS_REPO_SLUG" == "Manishearth/rust-clippy" ] &&
58        [ "$TRAVIS_BRANCH" == "master" ] &&
59        [ "$TRAVIS_TOKEN_CLIPPY_SERVICE" != "" ] ; then
60        curl -s -X POST \
61           -H "Content-Type: application/json" \
62           -H "Accept: application/json" \
63           -H "Travis-API-Version: 3" \
64           -H "Authorization: token $TRAVIS_TOKEN_CLIPPY_SERVICE" \
65           -d "{ \"request\": { \"branch\":\"master\" }}" \
66           https://api.travis-ci.org/repo/gnunicorn%2Fclippy-service/requests
67     else
68       echo "Ignored"
69     fi
70     set +e
71   fi