name: Makefile CI

on:
  push:
    branches: [ "master", "action-1" ]
  pull_request:
    branches: [ "master", "action-1" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    
    - name: configure
      run: ./autogen.sh && ./configure
      
    - name: Install dependencies
      run: make 
      
    - name: Werror run
      run: make clean ; CFLAGS="-O2 -Wall -Werror" make
      
    - name: clang run
      run: make clean ; CFLAGS="-O2 -Wall -Werror" CC=clang make 
      
    - name: Run check
      run: make check
      
    - name: Run distcheck
      run: make distcheck
