]>
Commit | Line | Data |
---|---|---|
041b39d2 XL |
1 | sudo: false |
2 | language: rust | |
3 | matrix: | |
4 | fast_finish: true | |
5 | include: | |
6 | - rust: nightly | |
abe05a73 XL |
7 | - rust: nightly |
8 | os: osx | |
9 | - rust: beta | |
041b39d2 | 10 | - rust: beta |
abe05a73 | 11 | os: osx |
041b39d2 | 12 | - rust: stable |
abe05a73 XL |
13 | - rust: stable |
14 | os: osx | |
15 | allow_failures: | |
16 | - rust: nightly | |
17 | ||
18 | before_cache: | |
19 | # Travis can't cache files that are not readable by "others" | |
20 | - chmod -R a+r $HOME/.cargo | |
21 | ||
22 | before_install: | |
23 | # install kcov | |
24 | - > | |
25 | if [ ! -d "$HOME/.kcov/bin" ]; then | |
26 | wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && | |
27 | tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && | |
28 | cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/.kcov .. && make && make install && cd ../.. | |
29 | fi | |
30 | - export PATH=$HOME/.kcov/bin:$PATH | |
31 | ||
041b39d2 XL |
32 | script: |
33 | - cargo build | |
abe05a73 | 34 | |
041b39d2 | 35 | cache: |
abe05a73 | 36 | cargo: true |
041b39d2 XL |
37 | apt: true |
38 | directories: | |
39 | - target/debug/deps | |
40 | - target/debug/build | |
abe05a73 | 41 | |
041b39d2 XL |
42 | addons: |
43 | apt: | |
44 | packages: | |
abe05a73 XL |
45 | - libcurl4-openssl-dev |
46 | - libelf-dev | |
47 | - libdw-dev | |
48 | - binutils-dev | |
49 | - libiberty-dev | |
50 | ||
51 | after_success: | |
52 | - '[ $TRAVIS_RUST_VERSION = stable ] && | |
53 | [ $TRAVIS_BRANCH = master ] && | |
54 | [ $TRAVIS_PULL_REQUEST = false ] && | |
55 | (ls target/debug && | |
56 | RUSTFLAGS="-C link-dead-code" cargo test --no-run && | |
57 | for file in target/debug/atty-*; do | |
58 | if [[ "${file: -2}" != ".d" ]]; then | |
59 | mkdir -p "target/cov/$(basename $file)"; | |
60 | kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; | |
61 | fi; | |
62 | done && | |
63 | kcov --coveralls-id=$COVERALLS_REPO_TOKEN --merge target/cov target/cov/* && | |
64 | echo "covered") || true' | |
65 | - '[ $TRAVIS_RUST_VERSION = stable ] && | |
66 | [ $TRAVIS_BRANCH = master ] && | |
67 | [ $TRAVIS_PULL_REQUEST = false ] | |
68 | && cargo doc --no-deps && | |
69 | echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d / -f 2`/index.html>" > target/doc/index.html && | |
70 | pip install --user ghp-import && | |
71 | /home/travis/.local/bin/ghp-import -n target/doc && | |
72 | git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages && | |
73 | echo "documented"' |