---
task:
  name: build
  freebsd_instance:
    matrix:
      image_family: freebsd-14-2

  env:
    CIRRUS_CLONE_DEPTH: 10

  pkginstall_script:
    - IGNORE_OSVERSION=yes pkg update -f
    - pkg install -y check
    - pkg install -y cyrus-sasl
    - pkg install -y gcc
    - pkg install -y gettext
    - pkg install -y gmake
    - pkg install -y hiredis
    - pkg install -y libsodium
    - pkg install -y libmaxminddb
    - pkg install -y libmemcached
    - pkg install -y mysql80-client
    - pkg install -y ncurses
    - pkg install -y openldap26-client
    - pkg install -y openssl
    - pkg install -y pcre
    - pkg install -y postgresql13-client
    - pkg install -y sqlite3
    - pkg install -y unixODBC
    # For the Redis unit tests
    - pkg install -y redis
    - service redis onestart

  # Note the following modules are NOT built:
  #
  #  - mod_geoip (no GeoIP package available)
  #  - mod_wrap (no libwrap package available)
  configure_script:
    - ./configure LDFLAGS="-L/usr/local/lib" LIBS="-lodbc -lm -lrt -pthread" --enable-ctrls --enable-facl --enable-memcache --enable-nls --enable-pcre --enable-redis --enable-tests --with-modules=mod_sql:mod_sql_mysql:mod_sql_odbc:mod_sql_postgres:mod_sql_sqlite:mod_sql_passwd:mod_sftp:mod_sftp_sql:mod_sftp_pam:mod_tls:mod_tls_fscache:mod_tls_shmcache:mod_tls_memcache:mod_tls_redis:mod_ban:mod_copy:mod_ctrls_admin:mod_deflate:mod_dnsbl:mod_dynmasq:mod_exec:mod_facl:mod_ifversion:mod_ldap:mod_load:mod_log_forensic:mod_qos:mod_quotatab:mod_quotatab_file:mod_quotatab_ldap:mod_quotatab_radius:mod_quotatab_sql:mod_radius:mod_readme:mod_rewrite:mod_shaper:mod_site_misc:mod_snmp:mod_wrap2:mod_wrap2_file:mod_wrap2_redis:mod_wrap2_sql:mod_digest:mod_auth_otp:mod_statcache:mod_unique_id:mod_ifsession

  compile_script:
    - gmake

  test_script:
    - gmake TEST_VERBOSE=1 check-api

  install_script:
    - gmake install
