freebsd_build_task:

  freebsd_instance:
    matrix:
      image_family: freebsd-12-4-snap
      image_family: freebsd-13-2-snap
    cpu: 4
    memory: 4G

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

  prepare_script:
    - sysctl -w kern.coredump=0
    - pkg update -f
    - 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; }
