summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 8b2752fa8ce34f74e17f7c471320898532761c60 (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
81
82
83
84
85
86
87
88
sudo: false
language: rust
rust:
- beta
- stable
cache: cargo
before_install:
- |
  c=$(git diff $(git merge-base master $TRAVIS_COMMIT)..$TRAVIS_COMMIT --name-only | cut -d "/" -f 1 | uniq)
  if [[ "$c" == "doc" ]]; then
      echo "Only changes in DOC, exiting 0"
      exit 0
  else
    echo "Changes in other directories than ./doc"
    echo "continue build..."
  fi
before_script:
- |
  pip install 'travis-cargo<0.2' --user &&
  export PATH=$HOME/.local/bin:$PATH
script:
- |
  travis_cargo_run_in() {
      echo ":: Trying to run cargo in $1"
      [[ -d "$1" ]] &&
      cd "$1" &&
      {
        {
          if [[ $(echo "$1" | grep lib) ]]; then
            travis-cargo -q test
          else
            travis-cargo -q build
          fi
        } &&
        cd -
      } || exit 1
  }

  run_sh_test() {
      echo "--- Running test script: '$1'"
        bash $1 || { echo "--- Test failed. Exiting"; exit 1; }
      echo "--- Test script $1 executed successfully"
  }

  echo "<< Changes in ./doc are not build by CI >>"

  for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
      echo ":: Working on $d"
      dir=$(dirname $d)
      { \
        echo -e "\n--- Running in $d ---\n" &&    \
          travis_cargo_run_in $dir &&             \
          echo "--- Running test scripts ---" &&  \
          for testsh in $(find $dir -iname "*test.sh"); do
            run_sh_test $testsh
          done && \
          echo -e "--- Done with test scripts ---\n\n"
      } || true
  done
addons:
  apt:
    packages:
    - cmake
    - libcurl4-openssl-dev
    - libdw-dev
    - libelf-dev
    - libzzip-dev
    - tree
    sources:
    - kalakris-cmake
after_success:
- |
  pushd .imag-documentation &&
  travis-cargo --only stable doc &&
  travis-cargo --only stable doc-upload
  popd
notifications:
  email:
    on_success: never
  irc:
    channels:
    - chat.freenode.net#imag
    template:
    - "%{repository_name} (%{branch} @ %{commit} by %{author}): %{result}"
env:
  global:
  - TRAVIS_CARGO_NIGHTLY_FEATURE=dev
  - secure: D+3exBnbvzFvk7fvLOxkF7UotCc4gBbvvOW4xGr9u6dDjEjV5y6CdDy/OQAkhfKhvSou+lIC22g5MuCBQXFEf/ua7A1XzwBAFeVLK4cWZSa7+ql6LdHKqOg3oF6pQlh095WeWr8S2PYJFFJFg8RGUPnbjqdu1J4KSXqe/7GoZ3lYS69mx7D5Hb93KEN084/KGfBuvyJtMjO1fK3spltL2zV8oqegFpv0gLG5GY4LsJ/7ij4Mc6wepXSyyQbaiA1eKMMwQZDvoi4V1mCulo/jeC3pucGxvgnMV5DZs8aa8R7votltGvSpHCgU78LW19dg8oZqwShQQ+XUYw27H+QK5V1lz1l1MaJLbwS3ySyZBPGH8qUuOzQ3bLp9xhAIRgCui3kX/UDhmeME7nJI6k3UZydh+/ydNB1BZHTKn76XS/yFj0Gcibxg7f5fcAYA6Ge5Sg+YPozuwbcKnKe6IpN2M7qNgWa+6MCSXJ1v4BgPb7kN74EynJUM8+yWEFN7MZtWEUQ4ZsHdCs8Pub4C/zHpYGV8qGenZwQzosAFq56YwoGCvJezz35yg4BDd3IMKenOzNnXLBrdxxqX8ySgwt5B3zBqwve/64Lx6OXjae2m8wZKlsmeqad/s6K7nx0zG15/qqRIzyvgcLXq3jwBaHkteq49FRFWvHQFpBQcsPZ2uH4=