language: c

matrix:
  include:
    - os: linux
      services:
        - docker
      script:
        - |
          bash -c "while true; do echo \$(date) - travis building ...; sleep 540; done" &
          export PING_LOOP_PID=$!
        - |
          cat <<-EOF | docker run -i ocaml/opam:ubuntu-16.04_ocaml-4.05.0 bash -
          set -e
          opam install -y coq=8.6.1
          git clone https://github.com/QinxiangCao/UnifySL
          cd UnifySL
          make depend
          make -j 2
          EOF
      after_script:
        - kill -9 $PING_LOOP_PID

    - os: osx
      before_script:
        - |
          bash -c "while true; do echo \$(date) - travis building ...; sleep 540; done" &
        - git clone https://github.com/asdf-vm/asdf.git
        - . asdf/asdf.sh
        - asdf plugin-add ocaml https://github.com/vic/asdf-ocaml.git
        - asdf install ocaml 4.05.0
        - asdf global ocaml 4.05.0
        - opam install -y coq=8.6.1
        - asdf reshim ocaml
      script:
        - git clone https://github.com/QinxiangCao/UnifySL
        - cd UnifySL
        - make depend
        - make -j 2
      after_script:
        - kill -9 $PING_LOOP_PID
