name: cppcheck

on: [push]

env:
  BUILD_TYPE: Release

jobs:
  run_cppcheck:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: install
      run: sudo apt-get install cppcheck
    - name: cppcheck
      working-directory: ${{runner.workspace}}/wxmaxima
      run: cppcheck --inline-suppr  --force --enable=all -DOPENMP_SPEC_DATE=0201511 -DHAVE_OPENMP_TASKS=1 -DHAVE_OMP_HEADER=1 -DGITVERSION="cppcheck" -DWXMAXIMA_GIT_VERSION="cppcheck" -DCMAKE_INSTAL_PREFIX="/usr" -DUSE_PRECOMP_HEADER=0 -q -i src/nanoSVG src --suppress="*:src/nanoSVG/nanosvg.h" --suppress="*:src/nanoSVG/nanosvgrast.h" -UWXK_NEXT -UWXK_NUMPAD_NEXT -UWXK_NUMPAD_PRIOR -UWXK_PRIOR -DCELLPTR_LOG_REFS=1 |& tee ../cppcheck.txt
    - uses: actions/upload-artifact@v2
      with:
         name: cppcheck.txt
         path: ${{runner.workspace}}/cppcheck.txt
