summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: cdbcc410b821234c550cbc648a5a3a42c11481f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
language: rust
rust:
  - stable
  - beta
os:
  - linux
  - osx
  - windows
jobs:
  allow_failures:
    - rust: nightly
    - env: TARGET=x86_64-pc-windows-gnu # Seems to cause problems.  TODO: Add test for it, but keep allow fail.
  fast_finish: true

before_install:
  - export RUST_BACKTRACE=1
  - |
    if [[ $TRAVIS_OS_NAME == "linux" ]]; then
      export TARGET=x86_64-unknown-linux-gnu;
    elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
      export TARGET=x86_64-pc-windows-msvc;
    elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
      export TARGET=x86_64-apple-darwin;
    fi
before_script:
  - rustup target add $TARGET
  - rustup component add clippy
script:
  - cargo clippy -- -D clippy::all
  - cargo build --verbose --target $TARGET
  - cargo test --verbose --target $TARGET

# Need to cache the whole `.cargo` directory to keep .crates.toml for cargo-update to work
cache:
  directories:
    - /home/travis/.cargo

# But don't cache the cargo registry.
before_cache:
  - rm -rf /home/travis/.cargo/git
  - rm -rf /home/travis/.cargo/registry

notifications:
  email:
    on_success: never

before_deploy:
  - |
    if [[ $TRAVIS_OS_NAME == "windows" ]]; then
      export TARGET=x86_64-pc-windows-msvc;
      cargo build --release --target $TARGET;
      cp ./target/x86_64-pc-windows-msvc/release/btm btm.exe;
      strip btm.exe;
      cp sample_configs/bottom.toml bottom.toml;
      tar -czvf bottom_x86_64-pc-windows-msvc.tar.gz btm.exe bottom.toml;
    else
        cargo build --release;
        cp ./target/release/btm btm;
        strip btm;
        cp sample_configs/bottom.toml bottom.toml;
        if [[ $TRAVIS_OS_NAME == "linux" ]]; then
          tar -czvf bottom_x86_64-unknown-linux-gnu.tar.gz btm bottom.toml;
          tar -czvf bottom_source_code.tar.gz ./src ./Cargo.toml LICENSE tests sample_config.toml bottom.toml;
        elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
          tar -czvf bottom_x86_64-apple-darwin.tar.gz btm bottom.toml;
        fi
    fi

deploy:
  provider: releases
  api_key:
    secure: ppBn0DnqZ+Rzb84doZQxYdUBQ0rVrZNIiH6ZSFEiCVJd0ttqXfOjK/qXbIf/zabwO0Olqz18jwd9piHjNigWRrHwX9N+YH0DZTM3f4WS2/2acvOP3AjSw6oERjYTwS5yKe/XP1sU11uL6O0oAxYFeiAkn7QOM7flVUE2BmmLAs2lLtQ+9ylmUeBGatrkTfQ0Z2i1o7p5mtI2fKUozpImtHq8TClQEsF4oQS5nvkHtpLuPQ0UrJ8vKZijDBeMuLbDkR121ujRnjoBt8+eXBRbwzAvVotwRozyol8noAN3i4VvYueId6oX7Y2DSEp26wnCuRXGurUnyya5JE55AKoevK+SUHRe5+29/2lPbC5d/etZt2tSX1AIJk9fHeIfRPSTzanIIyDpUzSGoMKjl1ARKGrgHYehRxMKpW0cC2xHSlQ+NrA5apLpXKr2IzpkGsxpAxLqRASbX2VJYCEL70WoJfXinZrxeDxXsaWBLGaj9ySyk059GZBMz9GBdYNtwF3G/3aSIt0nkEGgKipgYXHi5keKKGmyfeZyYkRJRbc369JRZiHuOWct+1ZsOdrKKdbyAdcDGj5kbKuYwA6E+wgI62IWvUTm+vtKDuIbLpu/48aOUuEslGHkYAszLTapX/Le9c9XTu3L+PMgkPq2LSyaeGrfnM+DE/Hwe3Jvurccp94=
  file_glob: true
  file: bottom_*.tar.gz
  skip_cleanup: true
  on:
    tags: true
    condition: "$TRAVIS_RUST_VERSION = stable"
    repo: ClementTsang/bottom
  draft: true