diff --git a/.github/actions/setup-cfe/action.yml b/.github/actions/setup-cfe/action.yml index 0a63a429c..a67e2dc05 100644 --- a/.github/actions/setup-cfe/action.yml +++ b/.github/actions/setup-cfe/action.yml @@ -8,6 +8,9 @@ inputs: source-dir: description: 'Directory to stage sources' required: true + org: + description: 'GitHub org that hosts the repos' + default: 'cFS' runs: using: 'composite' @@ -19,51 +22,59 @@ runs: - name: Checkout PSP uses: actions/checkout@v4 with: - repository: cFS/PSP + repository: ${{ inputs.org }}/PSP path: ${{ inputs.source-dir }}/psp + ref: dev - name: Checkout OSAL uses: actions/checkout@v4 with: - repository: cFS/osal + repository: ${{ inputs.org }}/osal path: ${{ inputs.source-dir }}/osal + ref: dev - name: Checkout CI_LAB uses: actions/checkout@v4 with: - repository: cFS/ci_lab + repository: ${{ inputs.org }}/ci_lab path: ${{ inputs.source-dir }}/apps/ci_lab + ref: dev - name: Checkout TO_LAB uses: actions/checkout@v4 with: - repository: cFS/to_lab + repository: ${{ inputs.org }}/to_lab path: ${{ inputs.source-dir }}/apps/to_lab + ref: dev - name: Checkout SCH_LAB uses: actions/checkout@v4 with: - repository: cFS/sch_lab + repository: ${{ inputs.org }}/sch_lab path: ${{ inputs.source-dir }}/apps/sch_lab + ref: dev - name: Checkout SAMPLE_APP uses: actions/checkout@v4 with: - repository: cFS/sample_app + repository: ${{ inputs.org }}/sample_app path: ${{ inputs.source-dir }}/apps/sample_app + ref: dev - name: Checkout SAMPLE_LIB uses: actions/checkout@v4 with: - repository: cFS/sample_lib + repository: ${{ inputs.org }}/sample_lib path: ${{ inputs.source-dir }}/libs/sample_lib + ref: dev - name: Checkout elf2cfetbl if: ${{ !env.CFE_EDS_ENABLED }} uses: actions/checkout@v4 with: - repository: cFS/elf2cfetbl + repository: ${{ inputs.org }}/elf2cfetbl path: ${{ inputs.source-dir }}/tools/elf2cfetbl + ref: dev - name: Add elf2cfetbl subdir if: ${{ !env.CFE_EDS_ENABLED }} @@ -75,8 +86,9 @@ runs: if: ${{ env.CFE_EDS_ENABLED }} uses: actions/checkout@v4 with: - repository: cFS/EdsLib + repository: ${{ inputs.org }}/EdsLib path: ${{ inputs.source-dir }}/tools/eds + ref: dev - name: Add edslib subdir if: ${{ env.CFE_EDS_ENABLED }} @@ -90,8 +102,9 @@ runs: - name: Checkout commandline-tools uses: actions/checkout@v4 with: - repository: cFS/commandline-tools + repository: ${{ inputs.org }}/cfs-commandline-tools path: ${{ inputs.source-dir }}/tools/commandline-tools + ref: dev - name: Add commandline-tools subdir shell: bash @@ -119,4 +132,4 @@ runs: pwd ls -la . cp -r ./cfe/cmake/sample_defs ./sample_defs - cp ./cfe/cmake/Makefile.sample ./Makefile + cp ./cfe/cmake/Makefile.sample ./Makefile \ No newline at end of file diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 5dd71739e..df01b02f6 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -12,94 +12,55 @@ on: - synchronize workflow_dispatch: schedule: - # 10:45 PM UTC every Sunday - - cron: '45 22 * * 0' + # 11:00 PM UTC every Sunday + - cron: '0 23 * * 0' +env: + WORK_PATH: ${{ github.workspace }} 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 bundle - uses: actions/checkout@v3 + - name: Checkout cFE + uses: actions/checkout@v4 with: - repository: nasa/cFS - submodules: true + path: cfe - - name: Checkout submodule - uses: actions/checkout@v3 + - name: Set up Dependencies + uses: ./cfe/.github/actions/setup-cfe with: - path: cfe + source-dir: . + preferred-ref: ${{ github.head_ref }} + org: 'nasa' + + # Setup the build system + - name: Set up for build + run: make SIMULATION=native prep - name: Cache Source and Build id: cache-src-bld uses: actions/cache@v3 with: - path: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/* - key: cfs-doc-${{ github.run_number }} + path: ${{ env.WORK_PATH }}/ + key: cfs-doc-${{ github.run_id }} build-cfe-usersguide: needs: checkout-and-cache name: Build and deploy cFE Docs - uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main + uses: nasa/cFS/.github/workflows/build-doc-reusable.yml@dev with: target: "[\"cfe-usersguide\"]" - cache-key: cfs-doc-${{ github.run_number }} + cache-key: cfs-doc-${{ github.run_id }} buildpdf: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} - deploy: false # Note can't use cache with deploy, deploy in following job instead build-mission-doc: - # see cFS issue #877, here: https://github.com/nasa/cFS/issues/877 - if: false # This will prevent the job from ever running needs: checkout-and-cache name: Build Mission Doc - uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main + uses: nasa/cFS/.github/workflows/build-doc-reusable.yml@dev with: target: "[\"mission-doc\"]" - cache-key: cfs-doc-${{ github.run_number }} - deploy: false - buildpdf: false # No need for mission pdf within cFE, done at bundle level - - deploy-documentation: - needs: build-cfe-usersguide - if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} - name: Deploy documentation to gh-pages - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: actions/download-artifact@v4.1.7 - - - 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@3.7.1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: deploy - SINGLE_COMMIT: true + cache-key: cfs-doc-${{ github.run_id }} + buildpdf: false # No need for mission pdf within cFE, done at bundle level \ No newline at end of file diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 18f3ded4e..5d80516de 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -18,160 +18,36 @@ on: env: SIMULATION: native ENABLE_UNIT_TESTS: true - OMIT_DEPRECATED: true + OMIT_DEPRECATED: false BUILDTYPE: debug - ALLOWED_MISSED_BRANCHES: 14 - ALLOWED_MISSED_LINES: 8 - ALLOWED_MISSED_FUNCTIONS: 0 -jobs: - #Check 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"]' - - Local-Test-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' }} +jobs: + Execute-Unit-Tests: + name: Build and Execute CFE unit tests runs-on: ubuntu-22.04 + container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest timeout-minutes: 15 steps: - name: Install coverage tools run: sudo apt-get install lcov -y - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout bundle - uses: actions/checkout@v3 - with: - repository: nasa/cFS - submodules: true - - - name: Checkout submodule - uses: actions/checkout@v3 + - name: Checkout cFE + uses: actions/checkout@v4 with: path: cfe - - name: Check versions - run: git submodule - - # Setup the build system - - name: Set up for build - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - make prep - make -C build mission-prebuild - - # Build the code - - name: Build - run: | - make -C build/native/default_cpu1/config - make -C build/native/default_cpu1/core_api - make -C build/native/default_cpu1/core_private - make -C build/native/default_cpu1/es - make -C build/native/default_cpu1/evs - make -C build/native/default_cpu1/fs - make -C build/native/default_cpu1/msg - make -C build/native/default_cpu1/resourceid - make -C build/native/default_cpu1/sb - make -C build/native/default_cpu1/sbr - make -C build/native/default_cpu1/tbl - make -C build/native/default_cpu1/time - - # Initialize lcov and test the code - - name: Test - run: | - lcov --capture --initial --directory build --output-file coverage_base.info - (cd build/native/default_cpu1/config && ctest --output-on-failure) - (cd build/native/default_cpu1/core_api && ctest --output-on-failure) - (cd build/native/default_cpu1/core_private && ctest --output-on-failure) - (cd build/native/default_cpu1/es && ctest --output-on-failure) - (cd build/native/default_cpu1/evs && ctest --output-on-failure) - (cd build/native/default_cpu1/fs && ctest --output-on-failure) - (cd build/native/default_cpu1/msg && ctest --output-on-failure) - (cd build/native/default_cpu1/resourceid && ctest --output-on-failure) - (cd build/native/default_cpu1/sb && ctest --output-on-failure) - (cd build/native/default_cpu1/sbr && ctest --output-on-failure) - (cd build/native/default_cpu1/tbl && ctest --output-on-failure) - (cd build/native/default_cpu1/time && ctest --output-on-failure) - - - 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]*") - function_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep functions | grep -oP "[0-9]+[0-9]*") - - branch_diff=$(echo $branch_nums | awk '{ print $4 - $3 }') - echo "branch_diff=$branch_diff" >> $GITHUB_ENV - line_diff=$(echo $line_nums | awk '{ print $4 - $3 }') - echo "line_diff=$line_diff" >> $GITHUB_ENV - function_diff=$(echo $function_nums | awk '{ print $4 - $3 }') - echo "function_diff=$function_diff" >> $GITHUB_ENV - - if [ $branch_diff -gt ${{ env.ALLOWED_MISSED_BRANCHES }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$branch_diff uncovered branch$([ $branch_diff -ne 1 ] && echo 'es') reported, but only ${{ env.ALLOWED_MISSED_BRANCHES }} ${{ env.ALLOWED_MISSED_BRANCHES == 1 && 'is' || 'are' }} allowed." - exit -1 - fi - - if [ $line_diff -gt ${{ env.ALLOWED_MISSED_LINES }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$line_diff uncovered line$([ $line_diff -ne 1 ] && echo 's') reported, but only ${{ env.ALLOWED_MISSED_LINES }} ${{ env.ALLOWED_MISSED_LINES == 1 && 'is' || 'are' }} allowed." - exit -1 - fi - - if [ $function_diff -gt ${{ env.ALLOWED_MISSED_FUNCTIONS }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$function_diff uncovered function$([ $function_diff -ne 1 ] && echo 's') reported, but only ${{ env.ALLOWED_MISSED_FUNCTIONS }} ${{ env.ALLOWED_MISSED_FUNCTIONS == 1 && 'is' || 'are' }} allowed." - exit -1 - fi - - - name: Enforce Keeping Branch Coverage Minimum Up-To-Date - run: | - if [ $branch_diff -lt ${{ env.ALLOWED_MISSED_BRANCHES }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$branch_diff uncovered branch$([ $branch_diff -ne 1 ] && echo 'es') reported, but ${{ env.ALLOWED_MISSED_BRANCHES }} ${{ env.ALLOWED_MISSED_BRANCHES == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update (lower) the 'ALLOWED_MISSED_BRANCHES' variable to $branch_diff in order to match the new coverage level." - exit -1 - fi - - - name: Enforce Keeping Line Coverage Minimum Up-To-Date - run: | - if [ $line_diff -lt ${{ env.ALLOWED_MISSED_LINES }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$line_diff uncovered line$([ $line_diff -ne 1 ] && echo 's') reported, but ${{ env.ALLOWED_MISSED_LINES }} ${{ env.ALLOWED_MISSED_LINES == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update (lower) the 'ALLOWED_MISSED_LINES' variable to $line_diff in order to match the new coverage level." - exit -1 - fi + - name: Set up Dependencies + uses: ./cfe/.github/actions/setup-cfe + with: + source-dir: . + preferred-ref: ${{ github.head_ref }} + org: 'nasa' - - name: Enforce Keeping Function Coverage Minimum Up-To-Date - run: | - if [ $function_diff -lt ${{ env.ALLOWED_MISSED_FUNCTIONS }} ] - then - grep -A 3 "Overall coverage rate" lcov_out.txt - echo "::error::$function_diff uncovered function$([ $function_diff -ne 1 ] && echo 's') reported, but ${{ env.ALLOWED_MISSED_FUNCTIONS }} ${{ env.ALLOWED_MISSED_FUNCTIONS == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update (lower) the 'ALLOWED_MISSED_FUNCTIONS' variable to $function_diff in order to match the new coverage level." - exit -1 - fi + - name: Execute coverage testing + uses: ./cfe/.github/actions/code-coverage + with: + module-list: config core_api core_private es evs fs msg resourceid sb sbr tbl time + allowed-missed-branches: 14 + allowed-missed-lines: 8 + allowed-missed-functions: 0 \ No newline at end of file diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 1046571db..d10bf3811 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -1,17 +1,18 @@ name: Format Check on: + push: + branches: + - dev + - main pull_request: types: - opened - reopened - synchronize workflow_dispatch: - schedule: - # 11:30 PM UTC every Sunday - - cron: '30 23 * * 0' jobs: format-check: name: Run format check - uses: nasa/cFS/.github/workflows/format-check.yml@main + uses: nasa/cFS/.github/workflows/format-check.yml@dev \ No newline at end of file diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 87074b4e7..655bfe677 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -13,100 +13,167 @@ on: workflow_dispatch: schedule: # 11:45 PM UTC every Sunday - - cron: '45 23 * * 0' + - cron: '45 23 * * 0' env: SIMULATION: native - ENABLE_UNIT_TESTS: true + ENABLE_UNIT_TESTS: false OMIT_DEPRECATED: true BUILDTYPE: release jobs: - - #Check 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"]' - Local-Test-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' }} + name: Build cFE runs-on: ubuntu-22.04 + container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest timeout-minutes: 15 steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout bundle - uses: actions/checkout@v3 - with: - repository: nasa/cFS - submodules: true - - - name: Checkout submodule + - name: Checkout cFE uses: actions/checkout@v3 with: path: cfe - - name: Check versions - run: git submodule + - name: Set up Dependencies + uses: ./cfe/.github/actions/setup-cfe + with: + source-dir: . + preferred-ref: ${{ github.head_ref }} + org: 'nasa' # Setup the build system - name: Set up for build - run: | - cp ./cfe/cmake/Makefile.sample Makefile - cp -r ./cfe/cmake/sample_defs sample_defs - make prep + run: make prep - # Setup the build system - - name: Make Install + - name: Build cFE run: make install + - name: Generate Startup Link + run: ln -s core-cpu1 ./build/exe/cpu1/container-start + - 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 + - name: Archive binaries run: | - ./core-cpu1 & + 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: functional-test-bin + path: ./*.tar.xz + + Execute-Test: + name: Execute Functional Test + permissions: + contents: read + actions: read + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_HOST: github.com + GH_REPO: cFS/cFE + runs-on: ubuntu-22.04 + needs: Local-Test-Build + timeout-minutes: 15 + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: functional-test-bin + path: functional-test-bin + + - name: Unpack artifacts + run: | + for i in cpu1 host + do + mkdir -p "$i" + tar Jxv -C "$i" -f "$GITHUB_WORKSPACE/functional-test-bin/$i-bin.tar.xz" + done + + - name: List Files + run: ls -lR . + + - name: Start CPU1 container + id: start-cpu1 + uses: nasa/cFS/actions/start-cfs-container@dev + with: + binary-dir: ${{ github.workspace }}/cpu1 + exec-image: ghcr.io/core-flight-system/cfsbuildenv-linux:latest + + - 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: Execute No-Op Check + working-directory: ./host + run: | + ./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --endian=LE --pktid=0x1806 --cmdcode=0 + sleep 2 + docker logs "${{ steps.start-cpu1.outputs.container-id }}" | grep -A 2 'CFE_ES 3: No-op command' + + - name: Launch Functional Test + working-directory: ./host + run: | + ./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --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 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 + docker logs "${{ steps.start-cpu1.outputs.container-id }}" - sleep 30 + - name: Wait for Functional Test + working-directory: ./cpu1 + run: | counter=0 + stuck=0 - while [[ ! -f cf/cfe_test.log ]]; do + while [ ! -f cf/cfe_test.log ] + do temp=$(grep -c "BEGIN" cf/cfe_test.tmp) + if [ $temp -eq $counter ] + then + stuck=$(($stuck + 1)) + else + stuck=0 + fi - if [ $temp -eq $counter ]; then + if [ $stuck -ge 3 ] + then echo "Test is frozen. Quitting" break fi counter=$(grep -c "BEGIN" cf/cfe_test.tmp) echo "Waiting for CFE Tests" - sleep 120 + sleep 30 done - ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 - working-directory: ./build/exe/cpu1/ + - name: Shut down CFE + if: ${{ always() && 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 1 + + - name: Stop CPU1 Container + if: ${{ always() && steps.start-cpu1.outputs.container-id != '' }} + uses: nasa/cFS/actions/stop-cfs-container@dev + with: + container-id: ${{ steps.start-cpu1.outputs.container-id }} - name: Archive cFS Startup Artifacts + if: always() uses: actions/upload-artifact@v4 with: - name: cFS-startup-log-deprecate-true-${{ matrix.buildtype }} - path: ./build/exe/cpu1/cf/cfe_test.log + name: cFS-startup-log-deprecate-true-release + path: cpu1/cf/cfe_test.log - name: Check for cFS Warnings run: | @@ -116,4 +183,4 @@ jobs: grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cf/cfe_test.log exit -1 fi - working-directory: ./build/exe/cpu1/ + working-directory: ./cpu1/ \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 488f57245..74d86418f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,6 +1,5 @@ name: Static Analysis -# Run on all push and pull requests on: push: branches: @@ -18,7 +17,36 @@ on: jobs: static-analysis: - name: Run cppcheck - uses: nasa/cFS/.github/workflows/static-analysis.yml@main - with: - strict-dir-list: './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' \ No newline at end of file + name: Run Static Analysis + runs-on: ubuntu-22.04 + container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest + timeout-minutes: 15 + + steps: + - name: Checkout CFE + uses: actions/checkout@v4 + with: + path: cfe + + - name: Set up Dependencies + uses: ./cfe/.github/actions/setup-cfe + with: + source-dir: . + preferred-ref: ${{ github.head_ref }} + org: 'nasa' + + # Setup the build system + - name: Create build tree + run: cmake -DCMAKE_INSTALL_PREFIX=/exe -DCMAKE_BUILD_TYPE=debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSIMULATION=native -S cfe -B build + + - name: List Files + run: ls -la build/native/* + + - name: Run cppcheck + uses: nasa/cFS/actions/cppcheck@dev + id: run-cppcheck + with: + strict-dir-list: './cfe/modules/core_api/fsw ./cfe/modules/core_private/fsw ./cfe/modules/es/fsw ./cfe/modules/evs/fsw ./cfe/modules/fs/fsw ./cfe/modules/msg/fsw ./cfe/modules/resourceid/fsw ./cfe/modules/sb/fsw ./modules/cfe/sbr/fsw ./modules/cfe/tbl/fsw ./cfe/modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER' + compile-commands-json: ./build/compile_commands.json ./build/native/default_cpu1/compile_commands.json + module-path: cfe + cppcheck-xslt-path: 'nasa/cFS/raw/refs/heads/dev/.github/scripts' \ No newline at end of file