name: run units target under VALGRIND

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

jobs:
  testing:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: update package information
      run: sudo apt-get update
    - name: install tools and libraries
      run: sudo apt-get install valgrind pkg-config automake bash libjansson-dev libyaml-dev libseccomp-dev libxml2-dev libpcre2-dev gdb
    - name: autogen.sh
      run: ./autogen.sh
    - name: report the version of cc
      run: cc --version
    - name: configure
      run: ./configure --enable-debugging
    - name: make
      run: make CFLAGS='-g -O0'
    - name: make units
      run: make units VG=1
