name: Keepalived CI

on:
  push:
  pull_request:
    paths-ignore:
    - 'doc/**'
    - 'docker/**'
    - 'goodies/**'
    - 'snap/**'
    - 'snap-tools/**'
    - 'test/**'
    - 'tools/**'

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        cmdline:
        - ""
        - "--enable-snmp --enable-snmp-rfc --enable-json --enable-dbus --disable-checksum-compat --enable-bfd --enable-asserts --disable-systemd"
        - "--enable-dbus --enable-dbus-create-instance --disable-dynamic-linking --disable-fwmark --disable-lvs-syncd --enable-snmp-vrrp --enable-timer-check --disable-iptables --disable-nftables --disable-track-process"
        - "--enable-dynamic-linking --disable-vrrp-auth --enable-snmp-rfc --disable-snmp-reply-v3-for-v2 --disable-nftables"
        - "--disable-libnl --enable-snmp-checker --disable-vmac"
        - "--enable-conversion-checks --enable-stacktrace --enable-mem-check --enable-mem-check-log --disable-lvs-64bit-stats --enable-snmp-rfcv2"
        - "--disable-lvs --enable-snmp-vrrp --enable-snmp-rfc --enable-json --enable-dbus --disable-routes --enable-bfd --disable-iptables --disable-linkbeat"
        - "--disable-vrrp --enable-snmp-checker --enable-regex"
        - "--disable-hardening --enable-dump-threads --enable-epoll-debug --enable-snmp-rfcv3 --enable-log-file --disable-libipset"
        - "--enable-snmp-rfc --enable-snmp --enable-dbus --enable-json --enable-bfd --enable-regex --enable-sockaddr-storage --enable-reproducible-build"
    steps:
    - uses: actions/checkout@v2
    - name: Install Dependencies
      run: sudo apt update && sudo apt install libsnmp-dev libxtables-dev libip4tc-dev libip6tc-dev libipset-dev libnfnetlink-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libssl-dev libmagic-dev libglib2.0-dev libpcre2-dev libmnl-dev libnftnl-dev libsystemd-dev
    - name: Configure
      run: |
        ./autogen.sh
        ./configure ${{ matrix.cmdline }}
    - name: Build
      run: make

