git-codeowners 0.1.2

Rust cli for working with Github CODEOWNERS files
dist: trusty
language: rust
services: docker
sudo: required

rust: stable

branches:
  only:
    # release tags
    - /^v\d+\.\d+\.\d+.*$/
    - master

env:
  global:
    - CRATE_NAME=git-codeowners
    - TARGET=x86_64-unknown-linux-musl
    - OS=Linux
    - ARCH=x86_64

matrix:
  include:
    - env: TARGET=x86_64-apple-darwin OS=Darwin ARCH=x86_64
      os: osx
    - env: TARGET=x86_64-unknown-linux-musl OS=Linux ARCH=x86_64

install:
  - sh ci/install.sh
  - source ~/.cargo/env || true

script:
  - bash ci/script.sh

before_cache:
  # Travis can't cache files that are not readable by "others"
  - chmod -R a+r $HOME/.cargo

cache:
  cargo: true
  apt: true
  directories:
  - target/debug/deps
  - target/debug/build
  - "$HOME/.rustup"

addons:
  apt:
    packages:
    - libcurl4-openssl-dev
    - libelf-dev
    - libdw-dev
    - binutils-dev
    - libiberty-dev

before_deploy:
  - sh ci/before_deploy.sh

deploy:
  # TODO update `api_key.secure`
  # - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
  # - Encrypt it: `travis encrypt GH_TOKEN=0123456789012345678901234567890123456789`
  # - Paste the output down here
  api_key:
    secure: $GH_TOKEN
  file_glob: true
  file: $CRATE_NAME-$OS-$ARCH.*
  on:
    # TODO Here you can pick which targets will generate binary releases
    # In this example, there are some targets that are tested using the stable
    # and nightly channels. This condition makes sure there is only one release
    # for such targets and that's generated using the stable channel
    condition: $TRAVIS_RUST_VERSION = stable
    tags: true
  provider: releases
  skip_cleanup: true

after_success: |-
  [ $TRAVIS_RUST_VERSION = stable ] &&
  [ $TRAVIS_BRANCH = master ] &&
  [ $TRAVIS_PULL_REQUEST = false ] &&
  [ $TRAVIS_OS_NAME = linux ] &&
  cargo doc --no-deps &&
  echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html &&
  pip install --user ghp-import &&
  /home/travis/.local/bin/ghp-import -n target/doc &&
  git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages &&
  wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
  tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp && cd ../.. &&
  ls target/$TARGET/debug &&
  ./kcov-master/tmp/usr/local/bin/kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/$TARGET/kcov target/$TARGET/debug/git-codeowners-*