name: build
on:
  pull_request:
    branches:
      - master
  push:
    branches:
      - master
jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos-latest
          - ubuntu-latest
          - windows-latest
        ocaml-version:
          - 4.14.0
        include:
          - os: ubuntu-latest
            ocaml-version: 4.08.0
    runs-on: ${{ matrix.os }}
    steps:
      - name: checkout
        uses: actions/checkout@v3
      - name: setup-ocaml
        uses: ocaml/setup-ocaml@v2
        with:
          ocaml-compiler: ${{ matrix.ocaml-version }}
      - name: setup
        run: |
          opam install dune ocamlformat.0.24.1
          opam exec -- dune build @fmt
          opam pin add . -y --no-action
          opam depext -y geneweb
          opam install -y ./*.opam --deps-only --with-test
      - name: makeci
        run: opam exec -- make ci
