# force run: 1
dist: xenial
language: c
compiler:
  - clang
  - gcc
python:
  - "3.6"
sudo: required
before_install:
    - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update
    - sudo apt-get -y install python3-pip python-dev
    - sudo pip3 install -U setuptools
    - sudo pip3 install -U virtualenvwrapper
    - which python
    - python --version
#    - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip3 install -r requirements.txt
    - pip3 install --user cpp-coveralls
env:
  global:
    - COVERALLS_PARALLEL=true
script: sh -x ./scripts/do-test.sh
after_success:
  - for f in `make -f tests/Makefile list_tests`;
    do
      cat tests/${f}.log;
    done
  - if [ "${CC}" = "gcc" ];
    then
      sh -x ./scripts/submit-coverage.sh ;
    fi
notifications:
  webhooks: https://coveralls.io/webhook

stages:
  - name: Build Documentation
  - name: Deploy Documentation
    if: branch = master AND type = push
jobs:
  include:
    - stage: Build Documentation
      name: Build Documentation
      script: sh -x ./scripts/do-docbuild.sh
    - stage: Deploy Documentation
      name: Deploy Documentation to the rtpproxy.org repo
      script: sh -x ./scripts/do-docdeploy.sh
      after_success:

# force run: 1
dist: xenial
language: c
compiler:
  - clang
  - gcc
python:
  - "3.6"
sudo: required
before_install:
    - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update
    - sudo apt-get -y install python3-pip python-dev
    - sudo pip3 install -U setuptools
    - sudo pip3 install -U virtualenvwrapper
    - which python
    - python --version
#    - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip3 install -r requirements.txt
    - pip3 install --user cpp-coveralls
env:
  global:
    - COVERALLS_PARALLEL=true
script: sh -x ./scripts/do-test.sh
after_success:
  - for f in `make -f tests/Makefile list_tests`;
    do
      cat tests/${f}.log;
    done
  - if [ "${CC}" = "gcc" ];
    then
      sh -x ./scripts/submit-coverage.sh ;
    fi
notifications:
  webhooks: https://coveralls.io/webhook

stages:
  - name: Build Documentation
    if: branch != master OR type != push
  - name: Build & Deploy Documentation
    if: branch = master AND type = push
jobs:
  include:
    - stage: Build Documentation
      name: Build Documentation
      script: sh -x ./scripts/do-docbuild.sh
      after_success:
    - stage: Build & Deploy Documentation
      name: Build Documentation and Deploy it to the rtpproxy.org repo
      script:
        - sh -x ./scripts/do-docbuild.sh
        - sh -x ./scripts/do-docdeploy.sh
      after_success:

Make build and build&deploy jobs mutually exclusive.
Make build and build&deploy jobs mutually exclusive.
