name: Autotools build

on:
  push:
  pull_request:
  schedule:
    - cron: '0 0 1 * *'

jobs:
  build:
    strategy:
      matrix:
        os:
          [
            ubuntu-latest,
            macos-latest,
          ]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2

      - name: Install macOS dependencies
        if: startsWith(matrix.os,'macos')
        run: brew install automake pkg-config

      - name: configure
        run: |
          ./autogen.sh
          ./configure

      - name: build
        run: make

      - name: test
        run: make check

      - name: distcheck
        run: make distcheck
