name: Build in docker
on:
  push:
    branches:
      - '1.30'
      - 'i686-cross'

env:
  OPAMROOT: /home/user/.opam
  OPAMCONFIRMLEVEL: unsafe-yes

jobs:
  build:
    runs-on: ubuntu-24.04
    container:
      image: kakadu18/ocaml:lama

    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true

    steps:
      - run: opam --version
      - run: whoami
      - run: opam exec -- ocamlopt --version

      - name: Checkout code
        uses: actions/checkout@v4

      - run: |
          opam install . --depext-only --with-test --with-doc
          opam install . --deps-only --with-test --with-doc

      - name: List installed packages
        run: opam list

      - run: opam exec -- dune build --profile=release
      - run: opam exec -- dune test regression/ stdlib/regression
