language: c
sudo: required

services:
  - docker

env:
  matrix:
    - IMAGE_NAME=ocaml/opam2:4.02 PKG_NAME=ppx_regexp
    - IMAGE_NAME=ocaml/opam2:4.02 PKG_NAME=ppx_tyre
    - IMAGE_NAME=ocaml/opam2:4.04 PKG_NAME=ppx_regexp
    - IMAGE_NAME=ocaml/opam2:4.04 PKG_NAME=ppx_tyre
    - IMAGE_NAME=ocaml/opam2:4.07 PKG_NAME=ppx_regexp
    - IMAGE_NAME=ocaml/opam2:4.07 PKG_NAME=ppx_tyre
    - IMAGE_NAME=ocaml/opam2:4.08 PKG_NAME=ppx_regexp
    - IMAGE_NAME=ocaml/opam2:4.08 PKG_NAME=ppx_tyre
    - IMAGE_NAME=ocaml/opam2:4.09 PKG_NAME=ppx_regexp
    - IMAGE_NAME=ocaml/opam2:4.09 PKG_NAME=ppx_tyre

before_install:
  - docker pull $IMAGE_NAME

script:
  - docker run --privileged -v `pwd`:/mnt:ro --env PKG_NAME=$PKG_NAME
        $IMAGE_NAME /mnt/.travis.sh
