dist: trusty
language: c
env:
  global:
    - GAPROOT=gaproot
    - COVDIR=coverage

addons:
  apt_packages:
    - libgmp-dev
    - libreadline-dev
    - libgmp-dev:i386
    - libreadline-dev:i386
    - gcc-multilib
    - g++-multilib
    - pari-gp

matrix:
  include:
    - env: CFLAGS="-O2"
      compiler: clang
    - env: CFLAGS="-O2"
      compiler: gcc
    - env: ABI=32

branches:
  only:
    - master

before_script:
  - scripts/build_gap.sh
  - scripts/build_pkg.sh
script:
  - scripts/run_tests.sh
after_script:
  - bash scripts/gather-coverage.sh
  - bash <(curl -s https://codecov.io/bash)
