on:
  pull_request:
  push:
  workflow_dispatch:
jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        ocaml-version: [
          4.03.0,
          4.04.0,
          4.05.0,
          4.06.0, 4.06.1,
          4.07.0, 4.07.1
        ]
    runs-on: "ubuntu-latest"
    steps:
      - name: "Checking out the repo..."
        uses: actions/checkout@v2
      - name: "Recovering cached opam files..."
        uses: actions/cache@v2
        with:
          path: ~/.opam
          key: ${{ runner.os }}-ocaml-${{ matrix.ocaml-version }}
      - name: "Setting up opam..."
        uses: avsm/setup-ocaml@v1
        with:
          ocaml-version: ${{ matrix.ocaml-version }}
      - name: "Installing patoline..."
        run: |
          eval $(opam env)
          opam update
          opam upgrade
          opam pin add -n -k path patoline .
          opam install --deps-only -d -t patoline
          opam install patoline
