name: Main workflow

on:
  pull_request:
  push:

permissions: read-all

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
        ocaml-compiler:
          - 4.13.1

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout tree
        uses: actions/checkout@v3

      - name: Set-up OCaml ${{ matrix.ocaml-compiler }}
        uses: ocaml/setup-ocaml@v2
        with:
          ocaml-compiler: ${{ matrix.ocaml-compiler }}

      - run: opam pin add Lama.dev . --no-action
      - run: opam depext Lama.dev --yes --with-test
      - run: opam install . --deps-only --with-test
      - run: eval $(opam env)
      - run: opam exec -- make
      - run: opam exec -- make regression-all
      - run: opam exec -- make unit_tests
      - run: opam exec -- make negative_scenarios_tests
