name: run units target under VALGRIND

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

jobs:
  testing:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - run: sudo apt-get update
    - run: sudo apt-get install valgrind pkg-config automake bash libjansson-dev libyaml-dev libseccomp-dev libxml2-dev libpcre2-dev gdb

    - run: cc --version

    - run: ./autogen.sh
    - run: ./configure --enable-debugging
    - run: make CFLAGS='-g -O0'
    - run: make units VG=1
