name: C/C++ CI

on:
  push:
    branches: [ "arping-2.x" ]
  pull_request:
    branches: [ "arping-2.x" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Required dependencies
      run:  sudo apt-get install -y libnet1-dev libpcap-dev automake autoconf check tcpdump openssh-server
    - name: bootstrap
      run:  ./bootstrap.sh
    - name: configure
      run:  ./configure
    - name: make
      run:  make
    - name: make check
      run:  make check
    - name: make distcheck
      run:  make distcheck
    - name: Install optional dependencies
      run:  sudo apt-get install -y libcap-dev libseccomp-dev
    - name: clean
      run:  make distclean
    - name: configure with optional deps
      run: ./configure
    - name: make with optional deps
      run:  make
    - name: make check with optional deps
      run:  make check
    - name: make distcheck with optional deps
      run:  make distcheck
    - name: end to end tests
      run:  sudo bash -x ./tests/run 10
