]> git.lizzy.rs Git - rust.git/blob - .travis.yml
enforce rustfmt on travis
[rust.git] / .travis.yml
1 language: rust
2 rust: nightly
3 sudo: false
4
5 cache:
6   cargo: true
7   directories:
8   - clippy_lints/target
9
10 env:
11  global:
12    # TRAVIS_TOKEN_CLIPPY_SERVICE
13    secure: dj8SwwuRGuzbo2wZq5z7qXIf7P3p7cbSGs1I3pvXQmB6a58gkLiRn/qBcIIegdt/nzXs+Z0Nug+DdesYVeUPxk1hIa/eeU8p6mpyTtZ+30H4QVgVzd0VCthB5F/NUiPVxTgpGpEgCM9/p72xMwTn7AAJfsGqk7AJ4FS5ZZKhqFI=
14
15 install:
16   - . $HOME/.nvm/nvm.sh
17   - nvm install stable
18   - nvm use stable
19   - npm install remark-cli remark-lint
20   - cargo install rustfmt
21
22 script:
23  - remark -f README.md > /dev/null
24  - python util/update_lints.py -c
25  - cargo fmt -- --write-mode=diff
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 -- -D clippy
32  - cd clippy_lints && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
33
34 after_success:
35 - ./.github/deploy.sh
36 # trigger rebuild of the clippy-service, to keep it up to date with clippy itself
37 - |
38     #!/bin/bash
39     set -e
40     if [ "$TRAVIS_PULL_REQUEST" == "false" ] &&
41        [ "$TRAVIS_REPO_SLUG" == "Manishearth/rust-clippy" ] &&
42        [ "$TRAVIS_BRANCH" == "master" ] &&
43        [ "$TRAVIS_TOKEN_CLIPPY_SERVICE" != "" ] ; then
44
45        curl -s -X POST \
46             -H "Content-Type: application/json" \
47             -H "Accept: application/json" \
48             -H "Travis-API-Version: 3" \
49             -H "Authorization: token $TRAVIS_TOKEN_CLIPPY_SERVICE" \
50             -d "{ \"request\": { \"branch\":\"master\" }}" \
51             https://api.travis-ci.org/repo/gnunicorn%2Fclippy-service/requests
52
53     else
54       echo "Ignored"
55     fi