Skip to content
Snippets Groups Projects
cppcheck.yml 1.13 KiB
Newer Older
  • Learn to ignore specific revisions
  • name: cppcheck
    
    on:
      push:
        branches: [ master, develop ]
      pull_request:
        branches: [ master, develop ]
    
    jobs:
      build:
        runs-on: ubuntu-latest
        container:
          image: nrel/cppcheck:2.3
        steps:
        - uses: actions/checkout@v3
        - name: Run cppcheck
          shell: bash
          run: |
              cppcheck \
                --std=c++14 \
                --enable=warning,style,information \
                --suppress=noExplicitConstructor \
                --suppress=useStlAlgorithm \
                --suppress=unmatchedSuppression \
                --suppress=unusedPrivateFunction \
                --inline-suppr \
                --inconclusive \
                --template='[{file}:{line}]:({severity}),[{id}],{message}' \
                -j $(nproc) \
                --force \
                ./include \
                3>&1 1>&2 2>&3 | tee cppcheck.txt
    
        - name: Parse and colorize cppcheck
          shell: bash
          run: python ./dev/ci/colorize_cppcheck_results.py
    
        - name: Upload cppcheck results as artifact
          if: ${{ always() }}
          uses: actions/upload-artifact@v2
          with:
              name: teqp-${{ github.sha }}-cppcheck_results.txt
              path: cppcheck.txt