language: c
dist: xenial
addons:
  # We run our builds sequentially in one VM rather than try and use the
  # matrix feature. This is because Travis is unreasonably inefficient
  # doing this APT setup pass.
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - debhelper
      - dh-systemd
      - fakeroot
      - gcc-8
      - git-core
      - libnl-3-dev
      - libnl-route-3-dev
      - libudev-dev
      - make
      - ninja-build
      - pandoc
      - pkg-config
      - python
      - valgrind
      - sparse
      - wget
      - abi-compliance-checker
      - abi-dumper

      # 32 bit support packages
      - gcc-multilib
      # xenial craziness, need to give specific version of multilib,
      # in addition to general multilib
      - gcc-8-multilib
      - lib32gcc-8-dev

      # pyverbs
      - python3-dev
      - python3-pip

service:
    - docker

before_script:
  - export LATEST_GCC_LINARO_URL=`wget -qO - https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/ | grep -o '<a href=['"'"'"].*gcc-linaro-.*x86_64_aarch64-linux-gnu.tar.xz['"'"'"]'  |  sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'`
  - export LATEST_GCC_LINARO_TAR=`basename $LATEST_GCC_LINARO_URL`
  - wget -q http://releases.linaro.org/$LATEST_GCC_LINARO_URL
  - mkdir $HOME/aarch64 && tar xf $LATEST_GCC_LINARO_TAR -C $HOME/aarch64 --strip 1
  - rm $LATEST_GCC_LINARO_TAR
  - http_proxy= pip3 install cython
script:
  - buildlib/travis-build
  - buildlib/travis-checkpatch
  - buildlib/package-build-test
  - buildlib/github-release
deploy:
  # Deploy assets to Github releases
  # https://docs.travis-ci.com/user/deployment/releases/
  provider: releases
  api_key:
    # This is encrypted OAth token generated by
    # Travis CLI tool (travis setup releases) limited to specific repo.
    secure: ok/WMzFgsSnk+NZ850QEUESHRfJ4Ae7T8eA4dcx4fuw2RqybAh8wjxrLP5GKR27WrzB3hKHHTi7fgE0VtBY024kGJ/+wlQXHN1p89JvCiQlGOKkxy5YIlS4GUhwwkqgoU+hmifxl1i+9yCuowHPIM4WoP+NR+IZgvMahlrdPCS2OleFtrqyaHZbC/Usdt0WZLeQzG+rVLec/NvPnVOn81e17yuAuluHAzu+qcV94szqe/zwDzG8RUUKXaeDEQ3JQja4bCLL/kTkWR8JGsfwvcqc9Ut4Ry2b7uEWp5/FIcxUGWviKRgRzEdcT40iMMiJbIrH7gYp66Ymr/dypqUfc4u/xSb4AmpTMcYGUXJxsdzKyL6d/7HbuHIIVc5o1V/L5mdaIjeO5KjTFjMMD5KoSXfBlNIGk2as1JD/99lxJ3VlpQGwI5390+Tyl8o4Ao4aBXSCG96PDK4+UkYFht/wrw+UoYdV07u3x7zz21O3N3Lu5733hDvcvyOW6uIzoeLQ5O62/3Pq+DOFRs/nnRiW8/gjIkEQAyj/GGxw/taslpFJFcdVt/MSueV4t5OCI2YdGA/NxG/c4FIGy+dntV5BB6Gld8KkP/PP74yzJ1o/PRDRExTbsQzrdisDrVIf0r4pxTTsw1gXRE5r6S0tQ5aNoXAQ5h4xiwAIGqqBF4HESJjA=
  file: rdma-core-*.tar.gz
  # Allow asterisks in file names.
  file_glob: true
  skip_cleanup: true
  # Limit scope of deploy to specific repo.
  on:
    repo: linux-rdma/rdma-core
    tags: true
