Skip to content

Commit

Permalink
Merge pull request #340 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFS Bundle Integration Candidate: 2021-08-24
  • Loading branch information
astrogeco committed Aug 21, 2021
2 parents 3ac39cd + 5678051 commit 4d681b3
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This action builds and tests the cFS bundle omitting deprecated code in both RTE
Build and Test in RTEMS 4.11 and 5 runs for every push and every pull request on all branches of cFS in Github Actions.

## CodeQL Analysis
[![CodeQL Analaysis](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml)
[![CodeQL Analysis](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml)

This action runs GitHub's static analysis engine, CodeQL, against our repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's code scanning alerts found under the security tab. CodeQL runs an extensible set of [queries](https://github.com/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.

Expand All @@ -33,8 +33,8 @@ For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-acti

Our CodeQL action uses a configuration file to use specific queries, which can be found at [.github/codeql](https://github.com/nasa/cFS/tree/main/.github/codeql).

## Static Analaysis
[![Static Analaysis](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml)
## Static Analysis
[![Static Analysis](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml)

This action runs a static analysis tool for C/C++ code known as cppcheck. Cppcheck is designed to be able to analyze C/C++ code even if it has non-standard syntax, which is common in embedded projects.

Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/static-analysis-misra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Static Analysis with MISRA

# Run this workflow manually from the Actions tab
on:
workflow_dispatch:

jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
check-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

misra-analysis:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: check-for-duplicates
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
name: Run cppcheck with misra
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
cppcheck: [bundle, cfe, osal, psp]

steps:
- name: Install cppcheck
run: sudo apt-get install cppcheck -y

# Checks out a copy of the cfs bundle
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true

- name: get MISRA addon
run: |
sudo apt-get install git -y
git clone https://github.com/danmar/cppcheck.git
cp cppcheck/addons/misra.py misra.py
cp cppcheck/addons/cppcheckdata.py cppcheckdata.py
cp cppcheck/addons/misra_9.py misra_9.py
- name: Run bundle cppcheck
if: ${{matrix.cppcheck =='bundle'}}
run: |
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
- 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
- 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
- name: Archive Static Analysis Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{matrix.cppcheck}}-cppcheck-err
path: ./*cppcheck_err.txt

- name: Check for errors
run: |
if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]];
then
cat ${{matrix.cppcheck}}_cppcheck_err.txt
exit -1
fi
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ git push --force
## Writing High-Quality Code

1. Follow cFS code conventions (formatting, symbol naming, file naming, etc). Do *not* change/reformat existing code, except to address your changes.
- The cFS submodules uses the Format Check workflow to ensure users follow the [clang-format-10](https://github.com/nasa/cFS/blob/main/.clang-format) style. For more information on how to use the Format Check workflow, view [Using GitHub Actions Workflows](#using-github-actions-workflows).
- The cFS submodules use the Format Check workflow to ensure users follow the [clang-format-10](https://github.com/nasa/cFS/blob/main/.clang-format) style. For more information on how to use the Format Check workflow, view [Using GitHub Actions Workflows](#using-github-actions-workflows).
- The [cFS_IdentifierNamingConvention document](https://github.com/nasa/cFE/blob/main/docs/cFS_IdentifierNamingConvention.md) provides a simple naming convention guide for cFE/cFS for commands and telemetry that simplifies the EDS to ground telemetry and commands database conversion.
- The [cFE Application Developers Guide](https://github.com/nasa/cFE/blob/main/docs/cFE%20Application%20Developers%20Guide.md) contains code conventions such as naming conventions for header files.

Expand All @@ -240,7 +240,7 @@ git push --force

5. Review the static code analyses results from the Static Analysis and CodeQL Analysis workflows. For more information on how to use these workflows, view [Using GitHub Actions Workflows](#using-github-actions-workflows).
- Push code changes to the appropriate forked repository.
- Go to the Actions tab and enable GitHub Actions Workflow. The CodeQL Analyis and Static Analysis will be triggered for all pushed code.
- Go to the Actions tab and enable GitHub Actions Workflow. The CodeQL Analysis and Static Analysis will be triggered for all pushed code.
- Review these workflows for any warnings or errors.
- Once successful, create a pull request.

Expand All @@ -264,7 +264,7 @@ All of our workflows will be available for forked repositories once enabled. To
1. Navigate to Actions in the selected repository. For newly forked repositories, enable workflows after clicking on Actions.
2. In the left sidebar, click the workflow you want to view.
3. From the list of workflow runs, click the name of the run you want to see.
4. Scroll to the bottom of the page and download the artifacts. For CodeQL results, navigate to the Security Tab and click Code scanning alerts. CodeQL results will only be avaiable on your forked repository.
4. Scroll to the bottom of the page and download the artifacts. For CodeQL results, navigate to the Security Tab and click Code scanning alerts. CodeQL results will only be available on your forked repository.

or

Expand Down Expand Up @@ -300,6 +300,6 @@ Before you [report bugs](#report-bugs) or submit [feature requests](#feature-req
* [elf2cfetbl Issues](https://github.com/nasa/elf2cfetbl/tree/6762b1c3b455665dae57e35f14a50fe327830391)
* [tblCRCTool Issues](https://github.com/nasa/tblCRCTool/tree/b02864ba56b12e00ab152225e3e8f9d6c039d48c)

If your bug or feature hasn't been reported or requested before, create a new issue in the appropriate repository. If it you find a similar issue, please add a comment on it with your experience or input.
If your bug or feature hasn't been reported or requested before, create a new issue in the appropriate repository. If you find a similar issue, please add a comment on it with your experience or input.

Please ensure that your name is associated with your github profile before contributing.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

For general cFS vulnerabilities, please [open a cFS framework issue](https://github.com/nasa/cfs/issues/new/choose). Please use the "Bug Report" template and provide as much information as possible. Apply appropriate labels for each report.

For security related vulnerabilities, follow the general cFS vulnerabilites instructions and tag the issue with the "security" label.
For security related vulnerabilities, follow the general cFS vulnerabilities instructions and tag the issue with the "security" label.

## Security Reports

Expand Down
2 changes: 1 addition & 1 deletion cfe
Submodule cfe updated 65 files
+31 −1 README.md
+5 −5 cmake/sample_defs/cpu1_msgids.h
+1 −1 cmake/sample_defs/cpu1_platform_cfg.h
+2 −0 cmake/sample_defs/global_build_options.cmake
+6 −5 cmake/sample_defs/sample_mission_cfg.h
+2 −2 docs/cFE_FunctionalRequirements.csv
+10 −4 docs/src/cfe_api.dox
+135 −0 modules/cfe_assert/inc/cfe_assert.h
+10 −9 modules/cfe_assert/src/cfe_assert_init.c
+16 −50 modules/cfe_assert/src/cfe_assert_io.c
+22 −0 modules/cfe_assert/src/cfe_assert_priv.h
+62 −0 modules/cfe_assert/src/cfe_assert_runner.c
+3 −0 modules/cfe_testcase/CMakeLists.txt
+3 −0 modules/cfe_testcase/src/cfe_test.c
+3 −20 modules/cfe_testcase/src/cfe_test.h
+28 −10 modules/cfe_testcase/src/es_cds_test.c
+7 −0 modules/cfe_testcase/src/es_misc_test.c
+87 −75 modules/cfe_testcase/src/msg_api_test.c
+219 −0 modules/cfe_testcase/src/resource_id_misc_test.c
+283 −0 modules/cfe_testcase/src/sb_sendrecv_test.c
+253 −0 modules/cfe_testcase/src/sb_subscription_test.c
+0 −1 modules/cfe_testcase/src/tbl_content_mang_test.c
+0 −24 modules/core_api/fsw/inc/cfe_error.h
+0 −1 modules/core_api/fsw/inc/cfe_es.h
+16 −1 modules/core_api/fsw/inc/cfe_msg.h
+1 −1 modules/core_api/fsw/inc/cfe_resourceid.h
+1 −6 modules/core_api/fsw/inc/cfe_sb.h
+76 −76 modules/core_api/fsw/inc/cfe_tbl.h
+1 −1 modules/core_api/fsw/inc/cfe_version.h
+19 −19 modules/core_private/ut-stubs/src/ut_osprintf_stubs.c
+27 −25 modules/es/fsw/src/cfe_es_api.c
+79 −66 modules/es/fsw/src/cfe_es_apps.c
+9 −8 modules/es/fsw/src/cfe_es_backgroundtask.c
+26 −20 modules/es/fsw/src/cfe_es_cds.c
+13 −5 modules/es/fsw/src/cfe_es_cds_mempool.c
+6 −4 modules/es/fsw/src/cfe_es_erlog.c
+9 −13 modules/es/fsw/src/cfe_es_mempool.c
+9 −6 modules/es/fsw/src/cfe_es_perf.c
+52 −58 modules/es/fsw/src/cfe_es_start.c
+13 −9 modules/es/fsw/src/cfe_es_syslog.c
+60 −35 modules/es/fsw/src/cfe_es_task.c
+14 −4 modules/es/ut-coverage/es_UT.c
+11 −8 modules/evs/fsw/src/cfe_evs_log.c
+19 −14 modules/evs/fsw/src/cfe_evs_task.c
+2 −2 modules/evs/ut-coverage/evs_UT.c
+47 −19 modules/fs/fsw/src/cfe_fs_api.c
+16 −17 modules/fs/fsw/src/cfe_fs_priv.c
+8 −8 modules/fs/ut-coverage/fs_UT.c
+6 −1 modules/resourceid/fsw/src/cfe_resourceid_api.c
+5 −1 modules/resourceid/ut-coverage/test_cfe_resourceid.c
+30 −27 modules/sb/fsw/src/cfe_sb_api.c
+5 −5 modules/sb/fsw/src/cfe_sb_init.c
+10 −16 modules/sb/fsw/src/cfe_sb_priv.c
+1 −1 modules/sb/fsw/src/cfe_sb_priv.h
+9 −1 modules/sb/ut-coverage/sb_UT.c
+1 −1 modules/tbl/fsw/src/cfe_tbl_api.c
+52 −22 modules/tbl/fsw/src/cfe_tbl_internal.c
+1 −1 modules/tbl/fsw/src/cfe_tbl_internal.h
+25 −24 modules/tbl/fsw/src/cfe_tbl_task_cmds.c
+238 −11 modules/tbl/ut-coverage/tbl_UT.c
+15 −0 modules/tbl/ut-coverage/tbl_UT.h
+19 −18 modules/time/fsw/src/cfe_time_task.c
+6 −6 modules/time/fsw/src/cfe_time_tone.c
+3 −3 modules/time/fsw/src/cfe_time_utils.c
+50 −7 modules/time/ut-coverage/time_UT.c
2 changes: 1 addition & 1 deletion osal

0 comments on commit 4d681b3

Please sign in to comment.