name: systemd-netlogd CI

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

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: update
      run: sudo apt-get update
    - name: install build essentials
      run: sudo apt-get install -y python3-sphinx ninja-build meson glib-2.0-dev libudev-dev libsystemd-dev clang gperf libcap-dev build-essential
    - name: build
      run: make
    - name: install
      run: sudo make install
    - name: add systemd-journal-netlog user
      run: sudo useradd -r -d / -s /usr/sbin/nologin -g systemd-journal systemd-journal-netlog
    - name: start systemd-netlogd
      run: sudo systemctl daemon-reload; sudo systemctl start systemd-netlogd
    - name: show status systemd-netlogd
      run: sudo systemctl status systemd-netlogd
