dist: trusty
sudo: required
language: c
cache:
  apt: true
  directories:
  - $HOME/.opam
addons:
  apt:
    sources:
    - avsm
    packages:
    - opam
    - aspcud
env:
  global:
  - NJOBS=2
  - COMPILER="4.05.0"
  # Main test targets
  matrix:
  - TEST_TARGET="v8.6"
  - TEST_TARGET="v8.7"
  - TEST_TARGET="v8.8"
  - TEST_TARGET="master"

install:
- opam init -j ${NJOBS} --compiler=${COMPILER} -n -y
- eval $(opam config env)
- opam config var root
- opam install -j ${NJOBS} -y ocamlfind camlp5 ${EXTRA_OPAM}
- opam list
- git clone --depth 1 -b ${TEST_TARGET} https://github.com/coq/coq.git coq-${TEST_TARGET}
- cd coq-${TEST_TARGET}
- ./configure -native-compiler no -local -coqide no
- make -j ${NJOBS}
- cd -

script:
- echo 'Building Mathcomp...' && echo -en 'travis_fold:start:mathcomp.build\\r'
- export PATH=`pwd`/coq-${TEST_TARGET}/bin:$PATH
- cd mathcomp
- make Makefile.coq
- make -f Makefile.coq -j ${NJOBS} all
- echo -en 'travis_fold:end:mathcomp.build\\r'
