]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Enable the cast_lossless warning by default.
[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 install:
18   - . $HOME/.nvm/nvm.sh
19   - nvm install stable
20   - nvm use stable
21   - npm install remark-cli remark-lint
22
23 script:
24  - PATH=$PATH:./node_modules/.bin
25  - remark -f README.md > /dev/null
26  - set -e
27  - cargo build --features debugging
28  - cargo test --features debugging
29  - mkdir -p ~/rust/cargo/bin
30  - cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy
31  - PATH=$PATH:~/rust/cargo/bin cargo clippy --all -- -D clippy
32  - cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
33  - cd clippy_workspace_tests/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../..
34  - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../..
35  - cd clippy_workspace_tests/subcrate/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../../..
36  - PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy
37  - cd clippy_workspace_tests/subcrate && PATH=$PATH:~/rust/cargo/bin cargo clippy --manifest-path=../Cargo.toml -- -D clippy && cd ../..
38  - set +e
39
40 after_success: |
41   #!/bin/bash
42   if [ $(uname) == Linux ]; then
43     ./.github/deploy.sh
44   # trigger rebuild of the clippy-service, to keep it up to date with clippy itself
45     set -e
46     if [ "$TRAVIS_PULL_REQUEST" == "false" ] &&
47        [ "$TRAVIS_REPO_SLUG" == "Manishearth/rust-clippy" ] &&
48        [ "$TRAVIS_BRANCH" == "master" ] &&
49        [ "$TRAVIS_TOKEN_CLIPPY_SERVICE" != "" ] ; then
50        curl -s -X POST \
51           -H "Content-Type: application/json" \
52           -H "Accept: application/json" \
53           -H "Travis-API-Version: 3" \
54           -H "Authorization: token $TRAVIS_TOKEN_CLIPPY_SERVICE" \
55           -d "{ \"request\": { \"branch\":\"master\" }}" \
56           https://api.travis-ci.org/repo/gnunicorn%2Fclippy-service/requests
57     else
58       echo "Ignored"
59     fi
60     set +e
61   fi