dist: xenial
language: c
cache: ccache

env:
  global:
    - GAP_PKGS_TO_CLONE="AutoDoc"

addons:
  apt:
    packages:
      - libgmp-dev
      - libreadline-dev
      - zlib1g-dev
      - ccache
  homebrew:
    packages:
      - gmp
      - ccache

matrix:
  include:
    - env: GAPBRANCH=master
    - env: GAPBRANCH=stable-4.11
    - env: GAPBRANCH=stable-4.10
    - env: GAPBRANCH=stable-4.9
    - env: GAPBRANCH=master PATH="/usr/local/opt/ccache/libexec:$PATH"
      os: osx
    - env: GAPBRANCH=master ABI=32
      addons:
        apt_packages:
          - libgmp-dev:i386
          - libreadline-dev:i386
          - zlib1g-dev:i386
          - ccache
          - gcc-multilib
          - g++-multilib

branches:
  only:
    - master

before_script:
  - git clone https://github.com/gap-system/pkg-ci-scripts.git scripts
  - scripts/build_gap.sh
  - ./build-normaliz.sh $HOME/gap
script:
  - scripts/build_pkg.sh && scripts/run_tests.sh
  - make doc
after_script:
  - scripts/gather-coverage.sh
  - bash <(curl -s https://codecov.io/bash)
