From 8dae82418e836518204f86fd200bfb15f391e75e Mon Sep 17 00:00:00 2001 From: ArielSAdamsNASA Date: Thu, 22 Jul 2021 13:56:49 -0500 Subject: [PATCH 1/2] Fix #310, No File Found for Documentation Workflow --- .github/workflows/build-documentation.yml | 50 +++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 3ba6c8f0f..b27ec9b8b 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -7,6 +7,7 @@ on: env: SIMULATION: native + REPO_NAME: ${{ github.event.repository.name }} jobs: #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. @@ -92,7 +93,7 @@ jobs: cp ./cfe/cmake/Makefile.sample Makefile cp -r ./cfe/cmake/sample_defs sample_defs - # Setup the build system + # Setup the build system - name: Make Prep run: make prep @@ -128,6 +129,28 @@ jobs: exit -1 fi + - name: Cache cFS Build Environment + id: cache-bundle + uses: actions/cache@v2 + with: + path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* + key: usersguide-buildnum-${{ github.run_number }} + + pdf-usersguide: + needs: build-usersguide + # Name the Job + name: PDF Users Guide + # Set the type of machine to run on + runs-on: ubuntu-18.04 + + steps: + - name: Cache cFS Build Environment + id: cache-bundle + uses: actions/cache@v2 + with: + path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* + key: usersguide-buildnum-${{ github.run_number }} + - name: PDF generation installs if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} run: | @@ -157,7 +180,7 @@ jobs: build-osalguide: # Name the Job needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }} + if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }} name: Osal Guide # Set the type of machine to run on runs-on: ubuntu-18.04 @@ -212,6 +235,27 @@ jobs: cat osalguide_warnings.log exit -1 fi + + - name: Cache cFS Build Environment + id: cache-bundle + uses: actions/cache@v2 + with: + path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* + key: osalguide-buildnum-${{ github.run_number }} + + pdf-osalguide: + needs: build-osalguide + # Name the Job + name: PDF Osal Guide + # Set the type of machine to run on + runs-on: ubuntu-18.04 + steps: + - name: Cache cFS Build Environment + id: cache-bundle + uses: actions/cache@v2 + with: + path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* + key: osalguide-buildnum-${{ github.run_number }} - name: PDF generation installs if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} @@ -236,4 +280,4 @@ jobs: BRANCH: gh-pages FOLDER: deploy CLEAN: false - SINGLE_COMMIT: true + SINGLE_COMMIT: true \ No newline at end of file From 0ef821896717d827dab5bf4e385de0b9b0f33385 Mon Sep 17 00:00:00 2001 From: Ariel Adams <69638935+ArielSAdamsNASA@users.noreply.github.com> Date: Wed, 27 Oct 2021 11:45:02 -0500 Subject: [PATCH 2/2] Revert "Fix #382, Reuse CodeQL, Static Analysis, and Format Check" --- .github/codeql/codeql-coding-standard.yml | 16 +++- .github/codeql/jpl-misra.qls | 21 ----- .github/workflows/README.md | 16 +--- .github/workflows/cFS-Reusable-Workflows.PNG | Bin 12526 -> 0 bytes .github/workflows/codeql-build-reuse.yml | 11 --- .github/workflows/codeql-build.yml | 78 +++++++++---------- .github/workflows/format-check.yml | 67 ---------------- .github/workflows/static-analysis-reuse.yml | 9 --- .github/workflows/static-analysis.yml | 64 +++++++-------- 9 files changed, 84 insertions(+), 198 deletions(-) delete mode 100644 .github/codeql/jpl-misra.qls delete mode 100644 .github/workflows/cFS-Reusable-Workflows.PNG delete mode 100644 .github/workflows/codeql-build-reuse.yml delete mode 100644 .github/workflows/format-check.yml delete mode 100644 .github/workflows/static-analysis-reuse.yml diff --git a/.github/codeql/codeql-coding-standard.yml b/.github/codeql/codeql-coding-standard.yml index 718b750e9..f68d01b42 100644 --- a/.github/codeql/codeql-coding-standard.yml +++ b/.github/codeql/codeql-coding-standard.yml @@ -3,5 +3,17 @@ name: "CodeQL Coding Standard Configuration File" disable-default-queries: true queries: - - name: JPL and MISRA - uses: ./.github/codeql/jpl-misra.qls \ No newline at end of file + - name: JPL Rules + uses: github/codeql/cpp/ql/src/JPL_C@main + - name: MISRA Rule 9-5-1 + uses: github/codeql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 153.ql@main + - name: MISRA Rule 5-18-1 + uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 168.ql@main + - name: MISRA 6-2-2 + uses: github/codeql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 202.ql@main + - name: MISRA Rule 5-14-1 + uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 165.ql@main + - name: MISRA Rule 5-3-2 + uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 165.ql@main + - name: MISRA Rule 7-5-2 + uses: github/codeql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 173.ql@main \ No newline at end of file diff --git a/.github/codeql/jpl-misra.qls b/.github/codeql/jpl-misra.qls deleted file mode 100644 index cfb114031..000000000 --- a/.github/codeql/jpl-misra.qls +++ /dev/null @@ -1,21 +0,0 @@ -# Start with all the queries in the codeql/cpp-queries pack. -- queries: . - from: codeql/cpp-queries -# Restrict to only the queries with the following ID patterns. -- include: - id: - # Regular expression matching all query IDs that start with `cpp/jpl-c/` - # This covers all queries in the `JPL_C` directory, - # but matching on query ID is more stable. - - /cpp/jpl-c/*/ - # Specific JSF queries, identified by query ID. - # MISRA Rule 9-5-1 - - cpp/jsf/av-rule-153 - # MISRA Rule 5-18-1 - - cpp/jsf/av-rule-168 - # MISRA 6-2-2 - - cpp/jsf/av-rule-202 - # MISRA Rule 5-14-1 - - cpp/jsf/av-rule-165 - # MISRA Rule 5-3-2 - - cpp/jsf/av-rule-173 \ No newline at end of file diff --git a/.github/workflows/README.md b/.github/workflows/README.md index eb1e3ed63..4a321cc83 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,15 +1,5 @@ # Our Workflows -## Reusable Workflows - -To reduce duplication, CodeQL Analysis, Static Analysis, and Format Checker are placed in cFS to be reused in the subrepositories. - -CodeQL Analysis and Static Analysis require inputs, therefore, they are called in an additional workflow in cFS to be utilized. Format checker does not need to be reused in cFS because it does not require inputs. - -Provided is a diagram of the architecture of the reusable workflows. - -![Reusable Workflows Architecture](cFS-Reusable-Workflows.PNG) - ## Deprecated Build, Test, and Run [![Deprecated Build, Test, and Run](https://github.com/nasa/cfs/actions/workflows/build-cfs-deprecated.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/build-cfs-deprecated.yml) @@ -35,8 +25,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 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) +## 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) 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. @@ -68,6 +58,6 @@ This action creates a changelog file which documents all the issues in cFS. The Changelog action runs manually. ## Format Check -[![Format Check](https://github.com/nasa/cfs/actions/workflows/format-check.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/format-check.yml) +[![Format Check](https://github.com/nasa/osal/actions/workflows/format-check.yml/badge.svg)](https://github.com/nasa/osal/actions/workflows/format-check.yml) This action uses [clang-format-10](https://github.com/nasa/cFS/blob/main/.clang-format) to check for format errors. diff --git a/.github/workflows/cFS-Reusable-Workflows.PNG b/.github/workflows/cFS-Reusable-Workflows.PNG deleted file mode 100644 index 02dc3ef36e2e64a1aa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ssCWeH@=e zr-l&Uf;6vvbM%nSY&sb$YOzT^MW~@v#>_CMTh-AUT29VBTHwFu$&aCWqk3%XLoATv z*(<;BQLFD6wN#-P#lrz!L^pc=hX$;n)eC5RK*yC%74l@a2h_e2v*nq<&(!HRrwN9x zZ;7NSW>wQhZ`sYhDt|YwVthS*36g2D^-r`X^|3)u?LV_2^I}Fu&%&3I=?DTHI~O~gbv+lBIsY6V7*9&2EZTCjlc-v{ zo*K~<%!0o62dCatzQQ&eZ(ks5=53NWXyw^6A~rY({P!g=^!j(iXoDlGOH+qm@g%xk zvx4rv7z3cCs=x^`aAC!@JasHP2%OpiM~_b@f5pAIMoXy=9NYpYmh-X{%7T>Exz!- z7E=O_IPDzz(kJ&^xrcL{ynIo1aCrSUrT={V@2cRe!vglsaW`lC(^#{`{||7&+U_Xf I@VRUM3s>N{XaE2J diff --git a/.github/workflows/codeql-build-reuse.yml b/.github/workflows/codeql-build-reuse.yml deleted file mode 100644 index 1b46be8d2..000000000 --- a/.github/workflows/codeql-build-reuse.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Reuse CodeQl Analysis - -on: - push: - pull_request: - - -jobs: - codeql: - name: CodeQL Analysis - uses: nasa/cFS/.github/workflows/codeql-build.yml@main \ No newline at end of file diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 6695f785d..e52049a07 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -1,24 +1,10 @@ -name: CodeQL Analysis +name: "CodeQL Analysis" on: - workflow_call: - inputs: - sample-defs: - description: 'Build Prep' - type: string - default: 'cp ./cfe/cmake/Makefile.sample Makefile && cp -r ./cfe/cmake/sample_defs sample_defs' - make-prep: - description: 'Make Prep' - type: string - default: '' - make: - description: 'Make Code' - type: string - default: 'make' - tests: - description: 'Tests' - type: string - default: '' + push: + pull_request: + branches: + - main env: SIMULATION: native @@ -40,7 +26,8 @@ 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 @@ -51,37 +38,42 @@ jobs: steps: # Checks out a copy of your repository - name: Checkout code + if: ${{ !steps.skip-workflow.outputs.skip }} uses: actions/checkout@v2 with: repository: nasa/cFS submodules: true - name: Check versions + if: ${{ !steps.skip-workflow.outputs.skip }} run: | git log -1 --pretty=oneline git submodule - name: Initialize CodeQL + if: ${{ !steps.skip-workflow.outputs.skip }} uses: github/codeql-action/init@v1 with: languages: c - config-file: nasa/cFS/.github/codeql/codeql-security.yml@main + config-file: ./.github/codeql/codeql-security.yml + # Setup the build system - name: Copy sample_defs - run: ${{ inputs.sample-defs }} - - - name: Make prep - run: ${{ inputs.make-prep }} + if: ${{ !steps.skip-workflow.outputs.skip }} + run: | + cp ./cfe/cmake/Makefile.sample Makefile + cp -r ./cfe/cmake/sample_defs sample_defs + # Setup the build system - name: Make Install - run: ${{ inputs.make }} - - - name: Run tests - run: ${{ inputs.tests }} + if: ${{ !steps.skip-workflow.outputs.skip }} + run: make + # Run CodeQL - name: Perform CodeQL Analysis + if: ${{ !steps.skip-workflow.outputs.skip }} uses: github/codeql-action/analyze@v1 - + CodeQL-Coding-Standard-Build: #Continue if check-for-duplicates found no duplicates. Always runs for pull-requests. needs: check-for-duplicates @@ -92,17 +84,20 @@ jobs: steps: # Checks out a copy of your repository - name: Checkout code + if: ${{ !steps.skip-workflow.outputs.skip }} uses: actions/checkout@v2 with: repository: nasa/cFS submodules: true - name: Check versions + if: ${{ !steps.skip-workflow.outputs.skip }} run: | git log -1 --pretty=oneline git submodule - name: Checkout codeql code + if: ${{ !steps.skip-workflow.outputs.skip }} uses: actions/checkout@v2 with: repository: github/codeql @@ -110,22 +105,25 @@ jobs: path: codeql - name: Initialize CodeQL + if: ${{ !steps.skip-workflow.outputs.skip }} uses: github/codeql-action/init@v1 with: languages: c - config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main + config-file: ./.github/codeql/codeql-coding-standard.yml + # Setup the build system - name: Copy sample_defs - run: ${{ inputs.sample-defs }} - - - name: Make prep - run: ${{ inputs.make-prep }} + if: ${{ !steps.skip-workflow.outputs.skip }} + run: | + cp ./cfe/cmake/Makefile.sample Makefile + cp -r ./cfe/cmake/sample_defs sample_defs + # Setup the build system - name: Make Install - run: ${{ inputs.make }} - - - name: Run tests - run: ${{ inputs.tests }} + if: ${{ !steps.skip-workflow.outputs.skip }} + run: make + # Run CodeQL - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 \ No newline at end of file + if: ${{ !steps.skip-workflow.outputs.skip }} + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml deleted file mode 100644 index ec83cc943..000000000 --- a/.github/workflows/format-check.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Format Check - -# Run on all push and pull requests -on: - push: - pull_request: - workflow_call: - -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"]' - - format-checker: - name: Run format check - #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: Install format checker - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' - sudo apt-get update && sudo apt-get install clang-format-10 - - - name: Checkout bundle - uses: actions/checkout@v2 - with: - repository: nasa/cFS - - - name: Checkout - uses: actions/checkout@v2 - with: - path: repo - - - name: Generate format differences - run: | - cd repo - find . -name "*.[ch]" -exec clang-format-10 -i -style=file {} + - git diff > $GITHUB_WORKSPACE/style_differences.txt - - - name: Archive Static Analysis Artifacts - uses: actions/upload-artifact@v2 - with: - name: style_differences - path: style_differences.txt - - - name: Error on differences - run: | - if [[ -s style_differences.txt ]]; - then - cat style_differences.txt - exit -1 - fi \ No newline at end of file diff --git a/.github/workflows/static-analysis-reuse.yml b/.github/workflows/static-analysis-reuse.yml deleted file mode 100644 index 50ded549c..000000000 --- a/.github/workflows/static-analysis-reuse.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Reuse Static Analysis - -on: - push: - -jobs: - static-analysis: - name: Static Analysis - uses: nasa/cFS/.github/workflows/static-analysis.yml@main \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 0926de7af..d7405dcf6 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,16 +1,9 @@ name: Static Analysis +# Run this workflow every time a new commit pushed to your repository and for pull requests on: - workflow_call: - inputs: - module: - description: 'GitHub Module' - type: string - default: 'bundle' - cppcheck-code: - description: 'Cppcheck Code' - type: string - default: '' + push: + pull_request: jobs: #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. @@ -36,6 +29,8 @@ jobs: strategy: fail-fast: false + matrix: + cppcheck: [bundle, cfe, osal, psp] steps: - name: Install cppcheck @@ -48,39 +43,38 @@ jobs: submodules: true - name: Run bundle cppcheck - run: cppcheck --force --inline-suppr --quiet . 2> ${{ inputs.module }}_cppcheck_err.txt - - - name: Archive static analysis artifacts for bundle - uses: actions/upload-artifact@v2 - with: - name: bundle-cppcheck-err - path: ./*cppcheck_err.txt + if: ${{matrix.cppcheck =='bundle'}} + run: cppcheck --force --inline-suppr --quiet . 2> ${{matrix.cppcheck}}_cppcheck_err.txt - - name: Check for errors for bundle - run: | - if [[ -s bundle_cppcheck_err.txt ]]; - then - cat $bundle_cppcheck_err.txt - exit -1 - fi - # Run strict static analysis for embedded portions of cfe, osal, and psp - - name: Strict cppcheck - if: ${{ inputs.module !='bundle' }} + - name: cfe strict cppcheck + if: ${{matrix.cppcheck =='cfe'}} run: | - ${{ inputs.cppcheck-code }} - - name: Archive static analysis artifacts - if: ${{ inputs.module !='bundle' }} + cd ${{matrix.cppcheck}} + cppcheck --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 --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 --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: ${{ inputs.module }}-cppcheck-err + name: ${{matrix.cppcheck}}-cppcheck-err path: ./*cppcheck_err.txt - name: Check for errors - if: ${{ inputs.module !='bundle' }} run: | - if [[ -s ${{ inputs.module }}_cppcheck_err.txt ]]; + if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]]; then - cat ${{ inputs.module }}_cppcheck_err.txt + cat ${{matrix.cppcheck}}_cppcheck_err.txt exit -1 - fi \ No newline at end of file + fi