branches:
  only:
    - develop
    - feature/VFS-6342-enable-bionic-build-and-test-on-travis

language: cpp

services:
  - docker

cache:
  - ccache: true
  - directories:
      - '~/.cache/rebar3'

dist: bionic

env:
  - ONEDATA_GIT_URL="https://github.com/onedata" REBAR_PROFILE="bamboo"

addons:
  apt:
    update: true
    sources:
      - sourceline: 'ppa:onedata/build-deps-2002'
    packages:
      - autoconf
      - aws-c-common
      - aws-c-event-stream
      - aws-checksums
      - aws-sdk-cpp-s3
      - bash-completion
      - bc
      - build-essential
      - ccache
      - cmake
      - curl
      - debhelper
      - devscripts
      - doxygen
      - erlang
      - folly
      - folly-dev
      - fuse
      - g++
      - gdb
      - git
      - glusterfs-common
      - glusterfs-dbg
      - golang-go
      - iputils-ping
      - jekyll
      - lcov
      - libacl1
      - libacl1-dev
      - libboost-all-dev
      - libboost-context1.65.1
      - libboost-filesystem1.65.1
      - libboost-iostreams1.65.1
      - libboost-log1.65.1
      - libboost-program-options1.65.1
      - libboost-python1.65.1
      - libboost-random1.65.1
      - libboost-system1.65.1
      - libboost-thread1.65.1
      - libbotan1.10
      - libbotan1.10-dev
      - libcurl4
      - libcurl4-openssl-dev
      - libdouble-conversion1
      - libfmt-dev
      - libfuse-dev
      - libgflags-dev
      - libgflags2.2
      - libgoogle-glog-dev
      - libgoogle-glog0v5
      - libgoogle-perftools-dev
      - libgoogle-perftools4
      - libiberty-dev
      - libjemalloc-dev
      - libjemalloc1
      - libltdl-dev
      - libnspr4
      - libnspr4-dev
      - libnss3
      - libnss3-dev
      - libpoco-dev
      - libpocofoundation50
      - libpoconetssl50
      - libpocoutil50
      - libpocoxml50
      - libprotobuf-dev
      - libprotobuf10
      - librados-dev
      - librados2
      - libradosstriper-dev
      - libradosstriper1
      - libsodium-dev
      - libsodium23
      - libspdlog-dev
      - libstdc++-7-dev
      - libtbb-dev
      - libtbb2
      - libunwind-dev
      - libunwind8
      - locales
      - nano
      - nfs-common
      - ninja-build
      - nodejs
      - openssl
      - pkg-config
      - protobuf-compiler
      - proxygen-dev
      - python
      - python-dev
      - python-pip
      - python-protobuf
      - python-rados
      - python-sphinx
      - python-xattr
      - python2.7-dev
      - python3
      - python3-dev
      - swift-sdk-cpp
      - unzip
      - uuid
      - uuid-dev
      - wangle-dev

before_script:
  - gem install coveralls-lcov
  - pip install six==1.12.0 dnspython Flask Flask-SQLAlchemy pytest==2.9.1 pytest-bdd==2.18.0 requests==2.5.1 boto boto3 rpyc==4.0.2 PyYAML xattr
  - curl -L https://github.com/erlang/rebar3/releases/download/3.11.1/rebar3 -o /usr/local/bin/rebar3 && chmod +x /usr/local/bin/rebar3
  - git config --global url."https://github.com/onedata".insteadOf "ssh://git@git.onedata.org:7999/vfs"

script:
  - >
    mkdir -p debug &&
    export PKG_REVISION=$(git describe --tags --always --abbrev=7) &&
    export PKG_COMMIT=$(git rev-parse --verify HEAD) &&
    export HELPERS_COMMIT=$(git -C helpers rev-parse --verify HEAD) &&
    cd debug &&
    cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DGIT_VERSION="$PKG_REVISION" -DGIT_COMMIT="$PKG_COMMIT" -DGIT_HELPERS_COMMIT="$HELPERS_COMMIT" -DCODE_COVERAGE=ON -DWITH_CEPH=ON -DWITH_SWIFT=ON -DWITH_S3=ON -DWITH_GLUSTERFS=ON -DWITH_WEBDAV=ON -DWITH_XROOTD=OFF -DWITH_ONEDATAFS=ON .. &&
    cd .. &&
    cmake --build debug &&
    cmake --build debug --target test &&
    py.test --verbose debug/test/integration/events_test &&
    make coverage/events_test &&
    py.test --verbose debug/test/integration/fslogic_test &&
    make coverage/fslogic_test &&
    make coverage_integration &&
    coveralls-lcov ./oneclient_integration_combined.info

after_script: set +e
