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