From e4da2ddeb1dccacdd252870ace03097631448051 Mon Sep 17 00:00:00 2001 From: Adams Date: Mon, 13 Apr 2026 15:46:23 -0500 Subject: [PATCH] Test #965 --- .github/workflows/README.md | 81 ------- .../Reusable-Workflows-Architecture.svg | 1 - .../app-static-analysis-reusable.yml | 34 --- .github/workflows/build-cfs-deprecated.yml | 229 ------------------ .github/workflows/build-cfs-rtems5.yml | 140 ----------- .github/workflows/build-cfs.yml | 227 ----------------- .github/workflows/build-doc-reusable.yml | 137 ----------- .github/workflows/build-documentation.yml | 87 ------- .github/workflows/build-run-app-reusable.yml | 186 -------------- .github/workflows/cfs-wiki.yml | 32 --- .github/workflows/changelog.yml | 38 --- .github/workflows/codeql-analysis.yml | 21 -- .github/workflows/codeql-reusable.yml | 160 ------------ .github/workflows/format-check.yml | 5 +- .github/workflows/static-analysis-misra.yml | 131 ---------- .github/workflows/static-analysis-reuse.yml | 9 - .github/workflows/static-analysis.yml | 122 ---------- .../workflows/unit-test-coverage-reusable.yml | 157 ------------ 18 files changed, 3 insertions(+), 1794 deletions(-) delete mode 100644 .github/workflows/README.md delete mode 100644 .github/workflows/Reusable-Workflows-Architecture.svg delete mode 100644 .github/workflows/app-static-analysis-reusable.yml delete mode 100644 .github/workflows/build-cfs-deprecated.yml delete mode 100644 .github/workflows/build-cfs-rtems5.yml delete mode 100644 .github/workflows/build-cfs.yml delete mode 100644 .github/workflows/build-doc-reusable.yml delete mode 100644 .github/workflows/build-documentation.yml delete mode 100644 .github/workflows/build-run-app-reusable.yml delete mode 100644 .github/workflows/cfs-wiki.yml delete mode 100644 .github/workflows/changelog.yml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/codeql-reusable.yml delete mode 100644 .github/workflows/static-analysis-misra.yml delete mode 100644 .github/workflows/static-analysis-reuse.yml delete mode 100644 .github/workflows/static-analysis.yml delete mode 100644 .github/workflows/unit-test-coverage-reusable.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md deleted file mode 100644 index 3f8b5ef30..000000000 --- a/.github/workflows/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Our Workflows - -## Reusable Workflows - -To reduce duplication, the workflows 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](./Reusable-Workflows-Architecture.svg) - -## 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) - -This action builds, tests, and runs the cFS bundle using deprecated code. The flag OMIT_DEPRECATED is set to false. For more information on the OMIT_DEPRECATED flag, see [global_build_options.cmake](https://github.com/nasa/cFE/blob/063b4d8a9c4a7e822af5f3e4017599159b985bb0/cmake/sample_defs/global_build_options.cmake). - -Build, Test, and Run runs for every push and every pull request on all branches of cFS in Github Actions. - -## Build, Test, and Run [OMIT_DEPRECATED=true] -[![Build, Test, and Run %5B OMIT_DEPRECATED=true %5B](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml) - -This action builds, tests, and runs the cFS bundle omitting deprecated code. - -Build, Test, and Run [OMIT_DEPRECATED=true] runs for every push and every pull request on all branches of cFS in Github Actions. For more information on the OMIT_DEPRECATED flag, see [global_build_options.cmake](https://github.com/nasa/cFE/blob/063b4d8a9c4a7e822af5f3e4017599159b985bb0/cmake/sample_defs/global_build_options.cmake). - -## Build and Test in RTEMS [OMIT_DEPRECATED=true] -[![Build and Test rtems 4.11 [OMIT_DEPRECATED=true]](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems4.11.yml/badge.svg)](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems4.11.yml) -[![Build and Test rtems 5 [OMIT_DEPRECATED=true]](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml/badge.svg)](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml) - -This action builds and tests the cFS bundle omitting deprecated code in both RTEMS 4.11 and RTEMS 5. - -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 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. - -CodeQL runs for every push and pull-request on all branches of cFS in GitHub Actions. - -For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action. - -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) - -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. - -The cFS Cppcheck GitHub Actions workflow and results are available to the public. To view the results, select a workflow and download the artifacts. - -Cppcheck runs for every push on the main branch and every pull request on all branches of cFS in Github Actions. - -For more information about Cppcheck, visit http://cppcheck.sourceforge.net/. - -## Local Unit Test -[![Local Unit Test](https://github.com/nasa/osal/actions/workflows/local_unit_test.yml/badge.svg)](https://github.com/nasa/osal/actions/workflows/local_unit_test.yml) - -This action tests our code using GCC's coverage testing tool gcov. - -Local Unit Test runs for every push and every pull request on all branches of cFS in Github Actions. - -## Documentation and Guides -[![Documentation and Guides](https://github.com/nasa/cfs/actions/workflows/build-documentation.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/build-documentation.yml) - -This action creates doxygen documents for cFE, cFS users guide, and osal guide. - -Documentation and Guides runs for every push and every pull request on all branches of cFS in Github Actions. The workflow pushes the PDFs for every push on the main branch. The PDFs can be found at https://github.com/nasa/cfs/tree/gh-pages. - -## Changelog -[![Changelog](https://github.com/nasa/cfs/actions/workflows/changelog.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/changelog.yml) - -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/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/Reusable-Workflows-Architecture.svg b/.github/workflows/Reusable-Workflows-Architecture.svg deleted file mode 100644 index bfa224833..000000000 --- a/.github/workflows/Reusable-Workflows-Architecture.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.github/workflows/app-static-analysis-reusable.yml b/.github/workflows/app-static-analysis-reusable.yml deleted file mode 100644 index 1ff37602e..000000000 --- a/.github/workflows/app-static-analysis-reusable.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Static Analysis Reusable Workflow - -on: - workflow_call: - inputs: - # Optional inputs - source-dir: - description: Directory containing source files - type: string - default: 'fsw' - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - static-analysis: - name: Run Static Analysis - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest - timeout-minutes: 15 - - steps: - - name: Checkout Source - uses: actions/checkout@v4 - with: - path: source - - - name: Run cppcheck - uses: nasa/cFS/actions/cppcheck@dev - id: run-cppcheck - with: - source-dir: source/${{ inputs.source-dir }} \ No newline at end of file diff --git a/.github/workflows/build-cfs-deprecated.yml b/.github/workflows/build-cfs-deprecated.yml deleted file mode 100644 index fbd048f1c..000000000 --- a/.github/workflows/build-cfs-deprecated.yml +++ /dev/null @@ -1,229 +0,0 @@ -name: Build, Test, and Run [OMIT_DEPRECATED = false] - -# Run every time a new commit pushed or for pull requests -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -env: - SIMULATION: native - OMIT_DEPRECATED: false - ENABLE_UNIT_TESTS: true - CTEST_OUTPUT_ON_FAILURE: true - REPO_NAME: ${{ github.event.repository.name }} - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -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"]' - - build-cfs-omit-deprecated-false: - name: "[Deprecated] Build" - needs: check-for-duplicates - if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - - steps: - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: deprecated-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: Checkout cFS - if: steps.cache-src-bld.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - submodules: true - - - name: Check versions - run: git submodule - - - name: Copy Makefile - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - - - name: Prep Build - run: make prep - - - name: Make - run: make install - - tests-and-coverage-omit-deprecated-false: - name: "[Deprecated] Run Unit Tests and Check Coverage" - needs: build-cfs-omit-deprecated-false - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - ENABLE_UNIT_TESTS: true - - steps: - - name: Install Dependencies - run: sudo apt-get install lcov -y - - - name: Cache Source and Deprecated Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: deprecated-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: Run Tests - run: make test - - - name: Check Coverage - run: make lcov - - run-cfs-omit-deprecated-false: - name: "[Deprecated] Run cFS" - needs: build-cfs-omit-deprecated-false - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - - steps: - - name: Cache Source and Deprecated Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: deprecated-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - - name: List cpu1 - run: ls build/exe/cpu1/ - - - name: Run cFS - run: | - ./core-cpu1 > cFS_startup_cpu1.txt & - sleep 30 - ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - working-directory: ./build/exe/cpu1/ - - - name: Archive cFS Startup Artifacts - uses: actions/upload-artifact@v4 - with: - name: cFS-startup-log-omit-deprecate-false${{ matrix.buildtype }} - path: ./build/exe/cpu1/cFS_startup_cpu1.txt - - - name: Check for cFS Warnings - run: | - if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then - echo "Must resolve warn|err|fail in cFS startup before submitting a pull request" - echo "" - grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt - exit -1 - fi - working-directory: ./build/exe/cpu1/ - - run-functional-test-app-omit-deprecated-false: - #Continue if check-for-duplicates found no duplicates. Always runs for pull-requests. - needs: run-cfs-omit-deprecated-false - name: "[DEPRECATED] cFS Functional Tests" - runs-on: ubuntu-22.04 - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - steps: - - name: Cache Source and Deprecated Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: deprecated-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: List cpu1 - run: ls build/exe/cpu1/ - - # Run cFS, send commands to set perf trigger and start perf data, and run functional tests - - name: Run cFS Functional Tests - run: | - ./core-cpu1 & - sleep 10 - ../host/cmdUtil --pktid=0x1806 --cmdcode=17 --endian=LE --uint32=3 --uint32=0x40000000 - ../host/cmdUtil --pktid=0x1806 --cmdcode=14 --endian=LE --uint32=2 - ../host/cmdUtil --pktid=0x1806 --cmdcode=4 --endian=LE --string="20:CFE_TEST" --string="20:CFE_TestMain" --string="64:cfe_testcase" --uint64=16384 --uint8=0 --uint8=0 --uint16=100 --uint32=0 - sleep 30 - counter=0 - while [[ ! -f cf/cfe_test.log ]]; do - temp=$(grep -c "BEGIN" cf/cfe_test.tmp) - - if [ $temp -eq $counter ]; then - echo "Test is frozen. Quiting" - break - fi - counter=$(grep -c "BEGIN" cf/cfe_test.tmp) - echo "Waiting for CFE Tests" - sleep 120 - done - - ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - working-directory: ./build/exe/cpu1/ - - - name: Archive Functional Test Artifacts - uses: actions/upload-artifact@v4 - with: - name: cFS-functional-test-log-omit-deprecate-false-${{ matrix.buildtype }} - path: ./build/exe/cpu1/cf/cfe_test.log - - - name: Check for cFS Warnings - run: | - if [[ -z $(grep -i "SUMMARY.*FAIL::0.*TSF::0.*TTF::0" cf/cfe_test.log) ]]; then - echo "Must resolve Test Failures in cFS Test App before submitting a pull request" - echo "" - grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cf/cfe_test.log - exit -1 - fi - working-directory: ./build/exe/cpu1/ diff --git a/.github/workflows/build-cfs-rtems5.yml b/.github/workflows/build-cfs-rtems5.yml deleted file mode 100644 index 33eba69ca..000000000 --- a/.github/workflows/build-cfs-rtems5.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Build and Test rtems 5 [OMIT_DEPRECATED=true] - -# Run every time a new commit pushed or for pull requests -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -env: - OMIT_DEPRECATED: true - CTEST_OUTPUT_ON_FAILURE: true - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -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"]' - - build-cfs: - #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: Build - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/qemu-rtems-5:latest - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - # Set home to where rtems is located - HOME: /root - - steps: - # Check out the cfs bundle - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - # Setup the build system - - name: Copy Files - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - ln -s /root/rtems-5 /opt/rtems-5 - - # Setup the build system - - name: Make Prep - run: make SIMULATION=i686-rtems5 prep - - - name: Make - run: make - - test-cfs: - name: Test - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/qemu-rtems-5:latest - - needs: build-cfs - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - ENABLE_UNIT_TESTS: true - # Set home to where rtems is located - HOME: /root - # Disable mcopy check otherwise disk image build fails - MTOOLS_SKIP_CHECK: 1 - - steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - # Setup the build system - - name: Copy Files - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - ln -s /root/rtems-5 /opt/rtems-5 - - # Setup the build system - - name: Make - run: | - make SIMULATION=i686-rtems5 prep - make install - - - name: Test - #run: .github/scripts/qemu_test.sh && .github/scripts/log_failed_tests.sh - run: make O=build SKIP_NET_TESTS=true RTEMS_VERSION=i686-rtems5 -f .github/scripts/rtems-test.mk all_tests -k - - - name: Output Failed Tests - run: | - # Check if failed-tests is empty or not - if [ -s ./build/exe/cpu1/failed-tests.log ]; then - echo "Failing tests found:" - cat ./build/exe/cpu1/failed-tests.log - fi - - # Always archive test logs - - name: Archive cFS Test Artifacts - uses: actions/upload-artifact@v4 - # Runs even if previous steps have failed - if: always() - with: - name: cFS-rtems-log-summary-${{ matrix.buildtype }} - path: ./build/exe/cpu1/*.log diff --git a/.github/workflows/build-cfs.yml b/.github/workflows/build-cfs.yml deleted file mode 100644 index 5024b02c5..000000000 --- a/.github/workflows/build-cfs.yml +++ /dev/null @@ -1,227 +0,0 @@ -name: Build, Test, and Run [OMIT_DEPRECATED = true] - -# Run every time a new commit pushed or for pull requests -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -env: - SIMULATION: native - OMIT_DEPRECATED: true - ENABLE_UNIT_TESTS: true - CTEST_OUTPUT_ON_FAILURE: true - REPO_NAME: ${{ github.event.repository.name }} - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -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"]' - - build-cfs-omit-deprecated-true: - name: Build - needs: check-for-duplicates - if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - - steps: - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: Checkout cFS - if: steps.cache-src-bld.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - submodules: true - - - name: Check versions - run: git submodule - - - name: Copy Makefile - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - - name: Prep Build - run: make prep - - - name: Make - run: make install - - tests-and-coverage-omit-deprecated-true: - name: Run Unit Tests and Check Coverage - needs: build-cfs-omit-deprecated-true - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - ENABLE_UNIT_TESTS: true - - steps: - - name: Install Dependencies - run: sudo apt-get install lcov -y - - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: Run Tests - run: make test - - - name: Check Coverage - run: make lcov - - run-cfs-omit-deprecated-true: - name: Run - needs: build-cfs-omit-deprecated-true - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - # Set the type of machine to run on - env: - BUILDTYPE: ${{ matrix.buildtype }} - - steps: - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - - name: List cpu1 - run: ls build/exe/cpu1/ - - - name: Run cFS - run: | - ./core-cpu1 > cFS_startup_cpu1.txt & - sleep 30 - ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - working-directory: ./build/exe/cpu1/ - - - name: Archive cFS Startup Artifacts - uses: actions/upload-artifact@v4 - with: - name: cFS-startup-log-omit-deprecate-true-${{ matrix.buildtype }} - path: ./build/exe/cpu1/cFS_startup_cpu1.txt - - - name: Check for cFS Warnings - run: | - if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then - echo "Must resolve warn|err|fail in cFS startup before submitting a pull request" - echo "" - grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt - exit -1 - fi - working-directory: ./build/exe/cpu1/ - - run-functional-test-app-omit-deprecated-true: - #Continue if check-for-duplicates found no duplicates. Always runs for pull-requests. - needs: run-cfs-omit-deprecated-true - runs-on: ubuntu-22.04 - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - buildtype: [debug, release] - - steps: - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* - key: build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }} - - - name: List cpu1 - run: ls build/exe/cpu1/ - - # Run cFS, send commands to set perf trigger and start perf data, and run functional tests - - name: Run cFS Functional Tests - run: | - ./core-cpu1 & - sleep 10 - ../host/cmdUtil --pktid=0x1806 --cmdcode=17 --endian=LE --uint32=3 --uint32=0x40000000 - ../host/cmdUtil --pktid=0x1806 --cmdcode=14 --endian=LE --uint32=2 - ../host/cmdUtil --pktid=0x1806 --cmdcode=4 --endian=LE --string="20:CFE_TEST" --string="20:CFE_TestMain" --string="64:cfe_testcase" --uint64=16384 --uint8=0 --uint8=0 --uint16=100 --uint32=0 - sleep 30 - counter=0 - while [[ ! -f cf/cfe_test.log ]]; do - temp=$(grep -c "BEGIN" cf/cfe_test.tmp) - - if [ $temp -eq $counter ]; then - echo "Test is frozen. Quiting" - break - fi - counter=$(grep -c "BEGIN" cf/cfe_test.tmp) - echo "Waiting for CFE Tests" - sleep 120 - done - - ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - working-directory: ./build/exe/cpu1/ - - - name: Archive cFS Startup Artifacts - uses: actions/upload-artifact@v4 - with: - name: cFS-functional-test-log-omit-deprecate-true-${{ matrix.buildtype }} - path: ./build/exe/cpu1/cf/cfe_test.log - - - name: Check for cFS Warnings - run: | - if [[ -z $(grep -i "SUMMARY.*FAIL::0.*TSF::0.*TTF::0" cf/cfe_test.log) ]]; then - echo "Must resolve Test Failures in cFS Test App before submitting a pull request" - echo "" - grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cf/cfe_test.log - exit -1 - fi - working-directory: ./build/exe/cpu1/ diff --git a/.github/workflows/build-doc-reusable.yml b/.github/workflows/build-doc-reusable.yml deleted file mode 100644 index 9bc5b32fe..000000000 --- a/.github/workflows/build-doc-reusable.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Build Document Reusable Workflow - -on: - workflow_call: - inputs: - # Required - target: - description: Document target name(s) as stringified JSON matrix list # Matrix example "[\"x\", \"y\"]" - type: string - required: true - # Optional - app-name: - description: Application name, leave blank if using cache - type: string - required: false - default: '' - cache-key: - description: Cache key to use - type: string - required: false - default: '' - buildpdf: - description: Build the PDF - type: boolean - required: false - default: false - needs_osal_api: - description: Whether this depends on the osal public api (compatibility bridge) - type: boolean - required: false - default: true - defs: - description: '*_defs directory' - type: string - required: false - default: 'sample_defs' - -env: - WORK_PATH: ${{ github.workspace }} - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - # Checks for duplicate actions. Skips push actions if there is a matching or - # duplicate pull-request action. - checks-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"]' - - build-doc: - needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') || contains(github.ref, 'dev') }} - name: Build Documentation - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/cfsbuildenv-doxygen:latest - - strategy: - fail-fast: false - matrix: - target: ${{ fromJson(inputs.target) }} - - steps: - - name: Get cache if supplied - id: cache-src-bld - if: ${{ inputs.cache-key != '' }} - uses: actions/cache@v4 - with: - path: ${{ env.WORK_PATH }}/ - key: ${{ inputs.cache-key }} - - - name: Set up app source - if: steps.cache-src-bld.outputs.cache-hit != 'true' - uses: nasa/cFS/actions/setup-app@dev - - - name: Generate OSAL header list - if: ${{ inputs.needs_osal_api == true }} - run: make -C build osal_public_api_headerlist - - - name: Build Document - run: | - make -C build ${{ matrix.target }} 2>&1 > ${{ matrix.target }}_stdout.txt | tee ${{ matrix.target }}_stderr.txt - mv build/docs/${{ matrix.target }}/${{ matrix.target }}-warnings.log . - - - name: Archive Document Build Logs - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}_doc_build_logs - path: | - ${{ matrix.target }}_stdout.txt - ${{ matrix.target }}_stderr.txt - ${{ matrix.target }}-warnings.log - - - name: Check For Document Build Errors - run: | - if [[ -s ${{ matrix.target }}_stderr.txt ]]; then - cat ${{ matrix.target }}_stderr.txt - exit 1 - fi - - - name: Check For Document Warnings - run: | - if [[ -s ${{ matrix.target }}-warnings.log ]]; then - cat ${{ matrix.target }}-warnings.log - exit 1 - fi - - - name: Generate PDF - if: ${{ inputs.buildpdf == true }} - run: | - if ! make LATEX_CMD="pdflatex -file-line-error -halt-on-error" -C ./build/docs/${{ matrix.target }}/latex > pdflatex.log; then - echo "Errors reported, tail of latex output follows" - tail -100 pdflatex.log - exit -1 - fi - mkdir -p deploy - mv ./build/docs/${{ matrix.target }}/latex/refman.pdf ./deploy/${{ matrix.target }}.pdf - # Could add pandoc and convert to github markdown - # pandoc ${{ matrix.target }}.pdf -t gfm - - - name: Archive PDF - if: ${{ inputs.buildpdf == true }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}_pdf - path: ./deploy/${{ matrix.target }}.pdf \ No newline at end of file diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml deleted file mode 100644 index ab68bda86..000000000 --- a/.github/workflows/build-documentation.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: cFS Documentation and Guides - -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - # Checks for duplicate actions. Skips push actions if there is a matching or - # duplicate pull-request action. - checks-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"]' - - checkout-and-cache: - name: Custom checkout and cache for cFS documents - needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - - name: Cache Source and Build - id: cache-src-bld - uses: actions/cache@v4 - with: - path: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/* - key: cfs-doc-${{ github.run_id }}-${{ github.run_attempt }} - - build-cfs-documentation: - needs: checkout-and-cache - name: Build cFS documents - uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main - with: - target: "[\"cfe-usersguide\", \"osal-apiguide\"]" - cache-key: cfs-doc-${{ github.run_id }}-${{ github.run_attempt }} - deploy: false - - deploy-documentation: - needs: build-cfs-documentation - if: ${{ github.event_name == 'push' && contains(github.ref, 'main') }} - name: Deploy documentation to gh-pages - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v4 - - - name: Display structure of downloaded files - run: ls -R - - - name: Move pdfs to deployment directory - run: mkdir deploy; mv */*.pdf deploy - - - name: Deploy to GitHub - uses: JamesIves/github-pages-deploy-action@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - folder: deploy - single-commit: true diff --git a/.github/workflows/build-run-app-reusable.yml b/.github/workflows/build-run-app-reusable.yml deleted file mode 100644 index 260bd1c4d..000000000 --- a/.github/workflows/build-run-app-reusable.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: Build And Run Reusable Workflow - -on: - workflow_call: - inputs: - # Optional inputs - app-name: - description: Application name, if different from repo name - type: string - required: false - default: ${{ github.event.repository.name }} - startup-string: - description: Startup string to confirm, default will use " Initialized." - type: string - required: false - default: '' - # Currently CFS apps have at most one dependency, so this only handles one for now - dependency: - description: Additional module/library that this app depends on - type: string - required: false - default: '' - app-entrypoint-suffix: - description: Symbol suffix to use as app entry point - type: string - required: false - default: 'AppMain' - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - # Checks for duplicate actions. Skips push actions if there is a matching or - # duplicate pull-request action. - checks-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"]' - - build-app: - needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') || contains(github.ref, 'dev') }} - name: Build CFE with app - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest - - steps: - # Note this also sets the APP_UPPER and APP_LOWER environment variables - - name: Set up app source - uses: nasa/cFS/actions/setup-app@dev - with: - app-name: ${{ inputs.app-name }} - dependency: ${{ inputs.dependency }} - - - name: Set up start string for verification - run: | - if [[ "${{ inputs.startup-string }}" == '' ]]; then - echo "START_STRING=$APP_UPPER Initialized." >> $GITHUB_ENV - else - echo "START_STRING=${{ inputs.startup-string }}" >> $GITHUB_ENV - fi - - - name: Make install - run: make -C build mission-install - - - name: Generate Startup Link - run: ln -s core-cpu1 ./build/exe/cpu1/container-start - - - name: Replace startup script - run: | - truncate -s 0 ./build/exe/cpu1/cf/cfe_es_startup.scr - if [ "x$APP_DEP_LOWER" != "x" ] - then - echo "CFE_LIB, $APP_DEP_LOWER, ${APP_DEP_UPPER}_Init, $APP_DEP_UPPER, 0, 0, 0x0, 0;" >> ./build/exe/cpu1/cf/cfe_es_startup.scr - fi - echo "CFE_APP, $APP_LOWER, ${APP_UPPER}_${{ inputs.app-entrypoint-suffix }}, $APP_UPPER, 80, 16384, 0x0, 0;" >> ./build/exe/cpu1/cf/cfe_es_startup.scr - cat ./build/exe/cpu1/cf/cfe_es_startup.scr - - - name: Archive binaries - run: | - cd $GITHUB_WORKSPACE/build/exe - find -maxdepth 1 -mindepth 1 -type d | while read dir - do - inst=$(basename ${dir}) - tar Jcv -f $GITHUB_WORKSPACE/${inst}-bin.tar.xz -C ${inst} . - done - - - name: Upload all artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.app-name }}-bin - path: ./*.tar.xz - - run-app: - needs: build-app - name: Run CFE with app, check for startup messages - runs-on: ubuntu-22.04 - - steps: - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: ${{ inputs.app-name }}-bin - path: ${{ inputs.app-name }}-bin - - - name: List Files 1 - run: ls -lR . - - - name: Unpack artifacts - run: | - for i in cpu1 host - do - mkdir -p "$i" - tar Jxv -C "$i" -f "$GITHUB_WORKSPACE/${{ inputs.app-name }}-bin/$i-bin.tar.xz" - done - - - name: List Files 2 - run: | - pwd - ls -lR . - - - name: Start CPU1 container - id: start-cpu1 - uses: nasa/cFS/actions/start-cfs-container@dev - with: - binary-dir: ${{ github.workspace }}/cpu1 - - - name: Check CPU1 container - id: check-cpu1 - uses: nasa/cFS/actions/healthcheck-logs@dev - with: - container-id: ${{ steps.start-cpu1.outputs.container-id }} - healthcheck-regex: 'CFE_ES_Main entering OPERATIONAL state$' - - - name: Shut down CFE - if: ${{ steps.check-cpu1.outputs.ip-addr != '' }} - working-directory: ./host - run: | - ./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - sleep 2 - - - name: Capture Logs - if: ${{ always() && steps.start-cpu1.outputs.container-id != '' }} - run: docker logs ${{ steps.start-cpu1.outputs.container-id }} > cFS_startup_cpu1.txt - - - name: Stop CPU1 Container - uses: nasa/cFS/actions/stop-cfs-container@dev - with: - container-id: ${{ steps.start-cpu1.outputs.container-id }} - - - name: Archive results - if: success() || failure() - uses: actions/upload-artifact@v4 - with: - name: cFS_startup_log - path: cFS_startup_cpu1.txt - - - name: Confirm startup string - run: | - if [[ -z $(grep "$START_STRING" cFS_startup_cpu1.txt) ]]; then - echo "Startup verification string not found in log: $START_STRING" - echo "" - echo "Possible related event messages:" - grep "/$APP_UPPER " cFS_startup_cpu1.txt - exit -1 - fi - - - name: Check for cFS Warnings - if: success() || failure() - run: | - if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then - echo "cFS startup warn|err|fail:" - echo "" - grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt - exit -1 - fi \ No newline at end of file diff --git a/.github/workflows/cfs-wiki.yml b/.github/workflows/cfs-wiki.yml deleted file mode 100644 index f3186d1b9..000000000 --- a/.github/workflows/cfs-wiki.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Update wiki - -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - - steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - - name: create CCB agenda - run: python3 .github/scripts/create_ccb_agenda.py - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Archive CCB agenda artifact - uses: actions/upload-artifact@v4 - with: - name: ccb-agenda - path: ./CCBAgenda.md \ No newline at end of file diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index 761cc088e..000000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Changelog - -# Controls when the action will run. -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Run Changelog - uses: heinrichreimer/github-changelog-generator-action@v2.1.1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - issuesLabel: "### Closed issues" - breakingLabel: "### Breaking changes" - enhancementLabel: "### Implemented enhancements" - bugsLabel: "### Fixed bugs" - deprecatedLabel: "### Deprecated" - removedLabel: "### Removed" - securityLabel: "### Security fixes" - pullRequests: false - author: false - - - name: "Upload changelog" - uses: actions/upload-artifact@v4 - with: - name: "Changelog" - path: CHANGELOG.md diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 0e1e1b0fa..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "CodeQL Analysis: cFS-Bundle" - -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - codeql: - uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main - with: - component-path: cFS - make: make -j8 - test: true diff --git a/.github/workflows/codeql-reusable.yml b/.github/workflows/codeql-reusable.yml deleted file mode 100644 index 641e1c6af..000000000 --- a/.github/workflows/codeql-reusable.yml +++ /dev/null @@ -1,160 +0,0 @@ -name: "CodeQL Reusable Workflow" - -on: - workflow_call: - inputs: - # REQUIRED Inputs - component-path: - description: 'Path to repo being tested in a cFS bundle setup' - type: string - required: true - default: cFS - - # Optional inputs - category: - description: 'Analysis Category' - required: false - type: string - - make: - description: 'Build Command' - default: '' #Typically `make` or `make install`. Default is blank for workflows that don't need to build source - required: false - type: string - - prep: - description: 'Make Prep' - default: make prep - required: false - type: string - - setup: - description: 'Build Prep Commands' - type: string - default: cp ./cfe/cmake/Makefile.sample Makefile && cp -r ./cfe/cmake/sample_defs sample_defs - required: false - - test: - description: 'Value for ENABLE_UNIT_TESTS flag' - type: string - default: false - required: false - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -env: - SIMULATION: native - ENABLE_UNIT_TESTS: ${{inputs.test}} - OMIT_DEPRECATED: true - BUILDTYPE: release - REPO: ${{github.event.repository.name}} - -jobs: - #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. - check-for-duplicates: - runs-on: ubuntu-22.04 - # 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"]' - - 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' }} - runs-on: ubuntu-22.04 - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - scan-type: [security, coding-standard] - - permissions: - security-events: write - - steps: - # Setup Bundle directory - - name: Setup cFS-Bundle directory (component-path = cFS) - if: inputs.component-path == 'cFS' - run: - echo "BUILD_DIRECTORY=${{github.workspace}}" >> $GITHUB_ENV - - - name: Setup cFS-Bundle directory (component-path != cFS) - if: inputs.component-path != 'cFS' - run: | - cd .. - git clone https://github.com/nasa/cFS.git --recurse-submodules - cd cFS - echo "BUILD_DIRECTORY=$(pwd)" >> $GITHUB_ENV - git log -1 --pretty=oneline - git submodule - rm -r .git - rm -rf ${{ inputs.component-path }} - ln -s ${{github.workspace}} ${{ inputs.component-path }} - - - - name: Checkout ${{ github.repository }} - uses: actions/checkout@v4 - with: - submodules: recursive - - # Setup the build system - - name: cFS Build Setup - run: | - ${{ inputs.setup }} - ${{ inputs.prep }} - working-directory: ${{env.BUILD_DIRECTORY}} - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: cpp - config-file: nasa/cFS/.github/codeql/codeql-${{matrix.scan-type}}.yml@main - - - name: Build - run: ${{ inputs.make }} - working-directory: ${{env.BUILD_DIRECTORY}} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - add-snippets: true - category: ${{matrix.scan-type}} - upload: false - output: CodeQL-Sarif-${{ matrix.scan-type }} - - - name: Rename Sarif - run: | - mv CodeQL-Sarif-${{ matrix.scan-type }}/cpp.sarif CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif - sed -i 's/"name" : "CodeQL"/"name" : "CodeQL-${{ matrix.scan-type }}"/g' CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif - - - name: filter-sarif - uses: zbazztian/filter-sarif@master - with: - patterns: | - -**/*.md - -**/*.txt - -**/*.dox - input: CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif - output: CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif - - - name: Archive Sarif - uses: actions/upload-artifact@v4 - with: - name: CodeQL-Sarif-${{ matrix.scan-type }} - path: CodeQL-Sarif-${{ matrix.scan-type }} - - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 6ab99dbe1..dfa2da383 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -45,7 +45,7 @@ jobs: path: repo - name: Get style from bundle - run: curl -fsL ${{ github.server_url }}/nasa/cFS/raw/refs/heads/dev/.clang-format > $GITHUB_WORKSPACE/clang-format.yml + run: curl -fsL ${{ github.server_url }}/arielswalker/cFS/raw/refs/heads/fix-965-update-clang-format-match-internal/.clang-format > $GITHUB_WORKSPACE/clang-format.yml - name: Check configuration run: clang-format-19 -style=file:$GITHUB_WORKSPACE/clang-format.yml --dump-config @@ -67,6 +67,7 @@ jobs: check-commit-message: name: Check Commit Message + needs: check-for-duplicates # Only run for pull-requests. if: ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'ic-') }} runs-on: ubuntu-22.04 @@ -77,7 +78,7 @@ jobs: uses: gsactions/commit-message-checker@v2 if: always() with: - pattern: ^((Fix|HotFix|Part|Issue|Ticket)\s([a-zA-Z0-9_-]+/)?[a-zA-Z0-9_-]*\#[0-9]+[,:]\s.+|Merge\spull\srequest\s\#[0-9]+\s.+|IC:\s.+) + pattern: '^((Fix|HotFix|Part|Issue|Ticket)\s(nasa/)?[a-zA-Z]*\#[0-9]+[,:]\s[a-zA-Z0-9]+|Merge\spull\srequest\s\#[0-9]+\s[a-zA-Z0-9]+|IC:\s[a-zA-Z0-9]+)' error: 'You need at least one "Fix|HotFix|Part|Issue|Ticket #<,|:> " line in the commit message.' excludeDescription: 'true' excludeTitle: 'true' diff --git a/.github/workflows/static-analysis-misra.yml b/.github/workflows/static-analysis-misra.yml deleted file mode 100644 index 928d33a6d..000000000 --- a/.github/workflows/static-analysis-misra.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Static Analysis with MISRA - -# Run this workflow manually from the Actions tab -on: - workflow_dispatch: - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -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@v4 - 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 . --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 --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 --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 --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: 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@v4 - if: ${{matrix.cppcheck =='bundle'}} - with: - name: ${{matrix.cppcheck}}-cppcheck-err - path: ./*cppcheck_err.* - - - name: Archive osal, cfe, and psp static analysis artifacts - uses: actions/upload-artifact@v4 - 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@v3 - with: - sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif' - checkout_path: ${{ env.CONTAINER_WORKSPACE }} - - - name: Check for errors - run: | - if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]]; - then - cat ${{matrix.cppcheck}}_cppcheck_err.txt - exit -1 - fi diff --git a/.github/workflows/static-analysis-reuse.yml b/.github/workflows/static-analysis-reuse.yml deleted file mode 100644 index 225b4a249..000000000 --- a/.github/workflows/static-analysis-reuse.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Bundle Static Analysis - -on: - workflow_dispatch: - -jobs: - static-analysis: - name: Static Analysis - uses: nasa/cFS/.github/workflows/static-analysis.yml@main diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index ec2a8c90e..000000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Static Analysis - -on: - workflow_call: - inputs: - strict-dir-list: - description: 'Directory List' - type: string - default: '' - cmake-project-options: - description: 'Command line options to pass to CMake' - type: string - default: '' - cppcheck-xslt-path: - description: 'Path to XSLT file for translating cppcheck XML output' - type: string - default: 'nasa/cFS/main/.github/scripts' - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. - check-for-duplicates: - name: 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"]' - - static-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 - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - - steps: - - name: Install cppcheck - run: | - sudo apt-get update - sudo apt-get install cppcheck xsltproc -y - - - name: Install sarif tool - run: npm install @microsoft/sarif-multitool - - - name: Fetch conversion XSLT - run: | - wget -O cppcheck-xml2text.xslt https://raw.githubusercontent.com/${{ inputs.cppcheck-xslt-path }}/cppcheck-xml2text.xslt - wget -O cppcheck-merge.xslt https://raw.githubusercontent.com/${{ inputs.cppcheck-xslt-path }}/cppcheck-merge.xslt - - # Checks out a copy of the reference repository - - name: Checkout subject repository - uses: actions/checkout@v4 - with: - path: source - submodules: true - - # For a CMake-based project, get the list of files by setting up a build with CMAKE_EXPORT_COMPILE_COMMANDS=ON and - # referencing the compile_commands.json file produced by the tool. This will capture the correct include paths and - # compile definitions based on how the source is actually compiled. - - name: CMake Setup - if: ${{ inputs.cmake-project-options != '' }} - run: | - cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/staging -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=debug ${{ inputs.cmake-project-options }} -S source -B build - echo CPPCHECK_OPTS=--project="$GITHUB_WORKSPACE/build/compile_commands.json" >> $GITHUB_ENV - - # For a Non-CMake project, just pass the base source directory of the repo. This will examine all .c files in the repo, - # but it will not see the macro definitions, and thus may not correctly interpret macro usage. - - name: Non-CMake Setup - if: ${{ inputs.cmake-project-options == '' }} - run: | - echo CPPCHECK_OPTS="$GITHUB_WORKSPACE/source" >> $GITHUB_ENV - - - name: Run general cppcheck - run: cppcheck --force --inline-suppr --xml $CPPCHECK_OPTS 2> cppcheck_err.xml - - # Run strict static analysis for selected portions of source code - - name: Run Strict cppcheck - if: ${{ inputs.strict-dir-list !='' }} - working-directory: ${{ github.workspace }}/source - run: cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive --xml ${{ inputs.strict-dir-list }} 2> ../strict_cppcheck_err.xml - - - name: Merge cppcheck results - if: ${{ inputs.strict-dir-list !='' }} - run: | - mv cppcheck_err.xml general_cppcheck_err.xml - xsltproc --stringparam merge_file strict_cppcheck_err.xml cppcheck-merge.xslt general_cppcheck_err.xml > cppcheck_err.xml - - - name: Convert cppcheck results to SARIF - run: npx "@microsoft/sarif-multitool" convert "cppcheck_err.xml" --tool "CppCheck" --output "cppcheck_err.sarif" - - - name: Convert cppcheck results to Markdown - run: xsltproc cppcheck-xml2text.xslt cppcheck_err.xml | tee $GITHUB_STEP_SUMMARY cppcheck_err.txt - - - name: Upload SARIF results - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: ${{ github.workspace }}/cppcheck_err.sarif - checkout_path: ${{ github.workspace }}/source - category: 'cppcheck' - - - name: Archive static analysis artifacts - uses: actions/upload-artifact@v4 - with: - name: cppcheck-errors - path: ./*cppcheck_err.* - - - name: Check for reported errors - run: tail -n 1 cppcheck_err.txt | grep -q '^\*\*0 error(s) reported\*\*$' diff --git a/.github/workflows/unit-test-coverage-reusable.yml b/.github/workflows/unit-test-coverage-reusable.yml deleted file mode 100644 index 2328ebbdb..000000000 --- a/.github/workflows/unit-test-coverage-reusable.yml +++ /dev/null @@ -1,157 +0,0 @@ -name: Unit Test and Coverage Reusable Workflow - -on: - workflow_call: - inputs: - # Optional inputs - app-name: - description: Application name, if different from repo name - type: string - required: false - default: ${{ github.event.repository.name }} - max-missed-branches: - description: Maximum number of missed branches - type: number - required: false - default: 0 - max-missed-lines: - description: Maximum number of missed lines - type: number - required: false - default: 0 - # Currently CFS apps have at most one dependency, so this only handles one for now - dependency: - description: Additional module/library that this app depends on - type: string - required: false - default: '' - -# Force bash to apply pipefail option so pipeline failures aren't masked -defaults: - run: - shell: bash - -jobs: - # Checks for duplicate actions. Skips push actions if there is a matching or - # duplicate pull-request action. - checks-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"]' - - unit-test-coverage: - needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') || contains(github.ref, 'dev') }} - name: Build, run unit tests and enforce coverage - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest - - steps: - - name: Set up environment variables - # Apps typically use lowercase targets and uppercase names, this logic is fragile but works - run: | - echo "APP_UPPER=$(echo ${{ inputs.app-name }} | sed 's/[a-z]/\U&/g')" >> $GITHUB_ENV - echo "APP_LOWER=$(echo ${{ inputs.app-name }} | sed 's/[A-Z]/\L&/g')" >> $GITHUB_ENV - APP_DEP="${{ inputs.dependency }}" - echo "APP_DEP_UPPER=$(echo ${APP_DEP##*/} | sed 's/[a-z]/\U&/g')" >> $GITHUB_ENV - echo "APP_DEP_LOWER=$(echo ${APP_DEP##*/} | sed 's/[A-Z]/\L&/g')" >> $GITHUB_ENV - - - name: Checkout CFE - uses: actions/checkout@v4 - with: - repository: nasa/cFE - path: cfe - ref: dev - - - name: Set up Dependencies - uses: ./cfe/.github/actions/setup-cfe - with: - source-dir: . - preferred-ref: ${{ github.head_ref }} - org: nasa - - - name: Checkout Repo - uses: actions/checkout@v4 - with: - path: apps/${{ env.APP_LOWER }} - - - name: Checkout Dependency - if: ${{ inputs.dependency != '' }} - uses: actions/checkout@v4 - with: - repository: ${{ inputs.dependency }} - path: apps/${{ inputs.dependency }} - ref: dev - - - name: Set up basic targets.cmake config - run: | - cat > ./sample_defs/targets.cmake << EOF - SET(MISSION_NAME GithubActions) - SET(SPACECRAFT_ID 0x42) - SET(MISSION_CPUNAMES cpu1) - SET(cpu1_PROCESSORID 1) - SET(MISSION_GLOBAL_APPLIST $APP_LOWER) - EOF - - - name: Add Dependencies to targets - run: | - if [ "x$APP_DEP_LOWER" != "x" ] - then - echo "LIST(APPEND MISSION_GLOBAL_APPLIST ${APP_DEP_LOWER})" >> ./sample_defs/targets.cmake - fi - cat ./sample_defs/targets.cmake - - - name: Make Prep - run: make SIMULATION=native ENABLE_UNIT_TESTS=true OMIT_DEPRECATED=false prep - - - name: Build app build dependencies - run: make -C build mission-prebuild - - - name: Build app target - run: | - make -C build/native/default_cpu1/apps/$APP_LOWER - - - name: Capture initial lcov and run test - run: | - lcov --capture --initial --directory build --output-file coverage_base.info - (cd build/native/default_cpu1/apps/$APP_LOWER; ctest --verbose) | tee test_results.txt - - - name: Calculate coverage - run: | - lcov --capture --rc lcov_branch_coverage=1 --directory build --output-file coverage_test.info - lcov --rc lcov_branch_coverage=1 --add-tracefile coverage_base.info --add-tracefile coverage_test.info --output-file coverage_total.info - genhtml coverage_total.info --branch-coverage --output-directory lcov | tee lcov_out.txt - - - name: Confirm minimum coverage - run: | - branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*") - line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*") - - branch_diff=$(echo $branch_nums | awk '{ print $4 - $3 }') - line_diff=$(echo $line_nums | awk '{ print $4 - $3 }') - if [ $branch_diff -gt ${{ inputs.max-missed-branches }} ] || [ $line_diff -gt ${{ inputs.max-missed-lines }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "$branch_diff branches missed, ${{ inputs.max-missed-branches }} allowed" - echo "$line_diff lines missed, ${{ inputs.max-missed-lines }} allowed" - exit -1 - fi - - - name: Archive results - # Upload if success or failure which supports skipping, unlike always() - if: success() || failure() - uses: actions/upload-artifact@v4 - with: - name: Unit test and coverage results - path: | - test_results.txt - lcov_out.txt - lcov \ No newline at end of file