name: Build and test

on: [push]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-18.04, ubuntu-20.04]
        conf-shared: [--enable-static, --enable-shared ]
        conf-xml: [--with-expat, --with-libxml2 ]
        conf-ssl: [--without-ssl, --with-ssl=openssl, --with-ssl=gnutls]
        conf-memleak: [--disable-memleak, --enable-memleak]
        conf-debug: [--enable-debug, --disable-debug]
    steps:
    - uses: actions/checkout@v2
    - run: ./autogen.sh
    - run: case ${{matrix.conf-ssl}} in
           *gnutls) sudo apt-get update && sudo apt-get -y install libgnutls28-dev gnutls-bin xmlto ;;
           esac
    - run: ./configure ${{matrix.conf-shared}} ${{matrix.conf-xml}}
                       ${{matrix.conf-ssl}} ${{matrix.conf-memleak}}
                       ${{matrix.conf-debug}}
    - run: make
    - run: make check
