name: C/C++ CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v2
    - name: update and install packages
      run: |
        sudo apt update
        sudo apt build-dep -y ./
        #Devscripts for bringing in debuild
        sudo apt install devscripts -y

    - name: autogen.sh
      run: ./autogen.sh
    - name: configure
      run: ./configure
    - name: make
      run: make
    - name: debuild
      run: debuild -B -us -uc
    - name: install deb
      run: sudo apt install ../synaptic_*.deb
    - name: remove deb
      run: sudo apt remove synaptic
# TODO ? add make check or distcheck?