summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 73356606d41e491dc7ebe67b67d3bb80a6ad635a (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
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

after_script:
  - |
    if [[ $TRAVIS_OS_NAME == "linux" ]]; then
      cp ./target/x86_64-unknown-linux-gnu/debug/btm btm;
      strip btm;
      tar -czvf bottom_x86_64-unknown-linux-gnu.tar.gz btm;
    elif [[ $TRAVIS_OS_NAME == "windows" ]]; then
      cp ./target/x86_64-pc-windows-msvc/debug/btm btm;
      strip btm;
      tar -czvf bottom_x86_64-pc-windows-msvc.tar.gz btm;
    elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
      cp ./target/x86_64-apple-darwin/debug/btm btm;
      strip btm;
      tar -czvf bottom_x86_64-apple-darwin.tar.gz btm;
    fi

deploy:
  provider: releases
  api_key:
    secure: nAzTrDADUZVpiTkpaTjfEZMFfyfgJV0jwrGvHx0u+DorGQIeuKIY+HTm6iOmU5OAdhPs5MBgqKJK2s9XoOxbw4qcC5uPHaRICX3yd63zi49gBwkE0FkCDOfrjR3xnsf9jNVFzfFFIoYAjY/67J9hzVmc9z9uhXIuokj6Hp0md/snjYpjeQi6QRi9n4zsTR60a4NanbeYJ9D+TdoJ4UyA3pdl7JOtQHwxgNPPpDij4aPz4mmdq0mlpFBYAMksMi9xhBXzB/AUgnsKvchpMcDZER2icHS5Yerq4buxcQjQgMYG10MKq24BeMfMR4lu9SAtKSgcclXvLDLdmY5DeMbrbup51xcuWcqouVwdw8aI7jOskFUKFFSmdEtEGeBG6PCf2fjsjpMjy0kZaO4HxS5kJJewLgXgpgQUQjRL5i2KGpO1pnMD4ev7CcdMrnQHZlNXbi6k6Z9FCOQukIcsmMjQEk4w2JSUCfX53wqQPV3ID4QKckTWrZkSayiet6rRFrRK4087fl7G3JjIMYG7+QbP8PoFkCCH3aUOPCg+3J2YockYB2Zjgnq/E/WNrt1rYxwA6ssKn8+7KqCLzXIv3gFHx9htE7nEvH6QH9dAacjT3bbaxkHpuS6+orxM12vL7+9K6j9HdePK8YqO+lByUmlBG8p91WIhgYkV4vLTAtO9FqA=
  file:
    - bottom_x86_64-unknown-linux-gnu.tar.gz
    - bottom_x86_64-pc-windows-msvc.tar.gz
    - bottom_x86_64-apple-darwin.tar.gz
  cleanup: false
  on:
    tags: true
    repo: ClementTsang/bottom
  draft: true