freebsd_build_task:

  freebsd_instance:
    matrix:
      image_family: freebsd-13-5
      image_family: freebsd-14-3
    cpu: 4
    memory: 4G

  env:
    DEPENDENCIES: automake libtool gmake gcc openssl python3
    PY_DEPS:      sphinx|netaddr|pyparsing
    matrix:
      COMPILER: gcc
      COMPILER: clang

  prepare_script:
    - sysctl -w kern.coredump=0
    - pkg update -f -r FreeBSD
    - pkg install -y ${DEPENDENCIES}
        $(pkg search -xq "^py3[0-9]+-(${PY_DEPS})-[0-9]+" | xargs)

  configure_script:
    - ./boot.sh
    - ./configure CC=${COMPILER} CFLAGS="-g -O2 -Wall"
                  MAKE=gmake --enable-Werror
                  || { cat config.log; exit 1; }

  build_script:
    - gmake -j8

  check_script:
    - gmake -j8 check TESTSUITEFLAGS=-j8 RECHECK=yes
                || { cat ./tests/testsuite.log; exit 1; }
