name: C/C++ CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Install nettle
      run: |
        sudo apt-get -y install nettle-dev
    - name: autogen.sh
      run: ./autogen.sh
    - name: configure
      run: ./configure
    - name: make
      run: make
    - name: make check
      run: make check
    - name: make distcheck
      run: make distcheck
    - name: Upload artifacts
      uses: actions/upload-artifact@v3
      with:
        name: tarball
        path: ./*.tar.*
