Skip to content

Commit

Permalink
Merge pull request nasa#590 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
IC: Caelum-rc4+dev25
  • Loading branch information
dzbaker authored Oct 11, 2022
2 parents 06121e4 + 9e16f02 commit 57168f4
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 43 deletions.
54 changes: 46 additions & 8 deletions .github/workflows/static-analysis-misra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
submodules: true

- name: get MISRA addon
- name: Get MISRA addon
run: |
sudo apt-get install git -y
git clone https://github.com/danmar/cppcheck.git
Expand All @@ -57,32 +57,70 @@ jobs:
- name: Run bundle cppcheck
if: ${{matrix.cppcheck =='bundle'}}
run: |
cppcheck --addon=misra --force --inline-suppr --quiet . --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml
cppcheck --addon=misra --force --inline-suppr --quiet . 2> ${{matrix.cppcheck}}_cppcheck_err.txt
# Run strict static analysis for embedded portions of cfe, osal, and psp
- name: cfe strict cppcheck
if: ${{matrix.cppcheck =='cfe'}}
run: |
cd ${{matrix.cppcheck}}
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER 2> ../${{matrix.cppcheck}}_cppcheck_err.txt
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER 2> ${{matrix.cppcheck}}_cppcheck_err.txt
- name: osal strict cppcheck
if: ${{matrix.cppcheck =='osal'}}
run: |
cd ${{matrix.cppcheck}}
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os 2> ../${{matrix.cppcheck}}_cppcheck_err.txt
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os 2> ${{matrix.cppcheck}}_cppcheck_err.txt
- name: psp strict cppcheck
if: ${{matrix.cppcheck =='psp'}}
run: |
cd ${{matrix.cppcheck}}
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw 2> ../${{matrix.cppcheck}}_cppcheck_err.txt
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml
cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw 2> ${{matrix.cppcheck}}_cppcheck_err.txt
- name: Convert bundle cppcheck to sarif
uses: airtower-luna/convert-to-sarif@v0.2.0
if: ${{matrix.cppcheck =='bundle'}}
with:
tool: 'CppCheck'
input_file: '${{matrix.cppcheck}}_cppcheck_err.xml'
sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif'

- name: Archive Static Analysis Artifacts
uses: actions/upload-artifact@v2
- name: Convert cfe, osal, psp cppcheck to sarif
uses: airtower-luna/convert-to-sarif@v0.2.0
if: ${{matrix.cppcheck !='bundle'}}
with:
tool: 'CppCheck'
input_file: '${{matrix.cppcheck}}/${{matrix.cppcheck}}_cppcheck_err.xml'
sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif'

- name: Define workspace
run: |
echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV}
- name: Archive bundle static analysis artifacts
uses: actions/upload-artifact@v3
if: ${{matrix.cppcheck =='bundle'}}
with:
name: ${{matrix.cppcheck}}-cppcheck-err
path: ./*cppcheck_err.txt
path: ./*cppcheck_err.*

- name: Archive osal, cfe, and psp static analysis artifacts
uses: actions/upload-artifact@v3
if: ${{matrix.cppcheck !='bundle'}}
with:
name: ${{matrix.cppcheck}}-cppcheck-err
path: ./${{matrix.cppcheck}}/*cppcheck_err.*

- name: Upload sarif results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif'
checkout_path: ${{ env.CONTAINER_WORKSPACE }}

- name: Check for errors
run: |
Expand Down
63 changes: 49 additions & 14 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,63 @@ jobs:
with:
submodules: true

- name: Run general cppcheck
run: cppcheck --force --inline-suppr . 2> general_cppcheck_err.txt
- name: Run general cppcheck
run: |
cppcheck --force --inline-suppr . --xml 2> general_cppcheck_err.xml
cppcheck --force --inline-suppr . 2> general_cppcheck_err.txt
- name: Convert general cppcheck
uses: airtower-luna/convert-to-sarif@v0.2.0
with:
tool: 'CppCheck'
input_file: 'general_cppcheck_err.xml'
sarif_file: 'general_cppcheck_err.sarif'

- name: Define workspace
run: |
echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV}
- name: Upload general SARIF results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'general_cppcheck_err.sarif'
checkout_path: ${{ env.CONTAINER_WORKSPACE }}

# 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 }} --xml 2> strict_cppcheck_err.xml
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: Convert strict cppcheck
uses: airtower-luna/convert-to-sarif@v0.2.0
if: ${{ inputs.strict-dir-list !='' }}
with:
tool: 'CppCheck'
input_file: 'strict_cppcheck_err.xml'
sarif_file: 'strict_cppcheck_err.sarif'

- name: Archive static analysis artifacts
uses: actions/upload-artifact@v3
with:
name: cppcheck-errors
path: ./*cppcheck_err.*

- name: Upload strict SARIF results
uses: github/codeql-action/upload-sarif@v2
if: ${{ inputs.strict-dir-list !='' }}
with:
sarif_file: 'strict_cppcheck_err.sarif'
checkout_path: ${{ env.CONTAINER_WORKSPACE }}

- 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> strict_cppcheck_err.txt

- name: Check for strict errors
if: ${{ inputs.strict-dir-list !='' }}
run: |
Expand All @@ -72,9 +113,3 @@ jobs:
cat strict_cppcheck_err.txt
exit -1
fi
- name: Archive Static Analysis Artifacts
uses: actions/upload-artifact@v2
with:
name: cppcheck-errors
path: ./*cppcheck_err.txt
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[![Build Linux](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml)
[![Build RTEMS 5](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml/badge.svg)](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml)
[![LGTM Alerts](https://img.shields.io/lgtm/alerts/github/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/alerts/?mode=list)
[![LGTM Grade](https://img.shields.io/lgtm/grade/cpp/g/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/context:cpp)
[![LGTM Grade](https://img.shields.io/lgtm/grade/python/g/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/context:python)

# Core Flight System - BUNDLE

Expand Down
8 changes: 0 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ CodeQL is ran for every push and pull-request on all branches of cFS in GitHub A

For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action.

### LGTM

LGTM [results](https://lgtm.com/projects/g/nasa/cFS?mode=list) are available to the public. Since suppression comments are not used, many warnings and errors may not be accurate. Therefore, the results may contain false positives and other inapplicable warnings and errors.

LGTM is ran for every pull-request on all branches of cFS.

For more information about LGTM, visit https://lgtm.com/.

### Cppcheck

The [cFS Cppcheck GitHub Actions workflow and results](https://github.com/nasa/cFS/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts.
Expand Down
2 changes: 1 addition & 1 deletion apps/ci_lab
2 changes: 1 addition & 1 deletion apps/sample_app
2 changes: 1 addition & 1 deletion apps/sch_lab
2 changes: 1 addition & 1 deletion cfe
Submodule cfe updated 106 files
2 changes: 1 addition & 1 deletion tools/elf2cfetbl
2 changes: 1 addition & 1 deletion tools/tblCRCTool

0 comments on commit 57168f4

Please sign in to comment.