diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 31a3b0d93..0e6d1f6b9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -32,8 +32,6 @@ jobs: strategy: fail-fast: false - matrix: - cppcheck: [non-strict, strict] steps: - name: Install cppcheck @@ -45,26 +43,33 @@ jobs: with: submodules: true - - name: Run bundle cppcheck - run: cppcheck --force --inline-suppr . 2> ${{matrix.cppcheck}}_cppcheck_err.txt + - name: Run general cppcheck + run: cppcheck --force --inline-suppr . 2> general_cppcheck_err.txt + - name: Check for general errors + run: | + if [[ -s general_cppcheck_err.txt ]]; + then + cat general_cppcheck_err.txt + exit -1 + fi + # Run strict static analysis for embedded portions of cfe, osal, and psp - name: Strict cppcheck if: ${{ inputs.strict-dir-list !='' }} - run: cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive .${{ inputs.strict-dir-list }} 2> ../${{matrix.cppcheck}}_cppcheck_err.txt + run: cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ${{ inputs.strict-dir-list }} 2> strict_cppcheck_err.txt + + - name: Check for strict errors + if: ${{ inputs.strict-dir-list !='' }} + run: | + if [[ -s strict_cppcheck_err.txt ]]; + then + cat strict_cppcheck_err.txt + exit -1 + fi - name: Archive Static Analysis Artifacts - if: ${{ inputs.strict-dir-list !='' || matrix.cppcheck == 'non-strict' }} uses: actions/upload-artifact@v2 with: - name: ${{matrix.cppcheck}}-cppcheck-err + name: cppcheck-errors path: ./*cppcheck_err.txt - - - name: Check for errors - if: ${{ inputs.strict-dir-list !='' || matrix.cppcheck == 'non-strict' }} - run: | - if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]]; - then - cat ${{matrix.cppcheck}}_cppcheck_err.txt - exit -1 - fi \ No newline at end of file