Skip to content

Commit

Permalink
Merge pull request #1042 from ArielSAdamsNASA/fix-1025-coding-standar…
Browse files Browse the repository at this point in the history
…ds-codeql

Fix #1025, Implement Coding Standard Rules in CodeQL
  • Loading branch information
astrogeco authored Jun 10, 2021
2 parents c540688 + 5493829 commit eb5082f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/codeql-cfe-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

CodeQL-Build:
CodeQL-Security-Build:
needs: check-for-duplicates
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-18.04
Expand All @@ -50,7 +50,49 @@ jobs:
uses: github/codeql-action/init@v1
with:
languages: c
queries: +security-extended, security-and-quality
config-file: nasa/cFS/.github/codeql/codeql-security.yml@main

- name: Set up for build
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
make prep
- name: Build
run: make -j native/default_cpu1/osal/

- name: Run tests
run: (cd build/native/default_cpu1/osal && make test)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

CodeQL-Coding-Standard-Build:
needs: check-for-duplicates
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-18.04
timeout-minutes: 15

steps:
- name: Checkout bundle
uses: actions/checkout@v2
with:
repository: nasa/cFS
submodules: true

- name: Checkout submodule
uses: actions/checkout@v2
with:
path: osal

- name: Check versions
run: git submodule

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: c
config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main

- name: Set up for build
run: |
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/codeql-osal-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,36 @@ jobs:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

CodeQL-Security-Build:
#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' }}
runs-on: ubuntu-18.04
timeout-minutes: 15

steps:
- name: Checkout submodule
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: c
config-file: nasa/cFS/.github/codeql/codeql-security.yml@main

- name: Set up for build
run: |
cp Makefile.sample Makefile
make prep
- name: Build
run: make -j

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

CodeQL-Build:
CodeQL-Coding-Standard-Build:
#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' }}
Expand All @@ -43,7 +70,7 @@ jobs:
uses: github/codeql-action/init@v1
with:
languages: c
queries: +security-extended, security-and-quality
config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main

- name: Set up for build
run: |
Expand Down

0 comments on commit eb5082f

Please sign in to comment.