From 3c1758822ce1271ba4394e74f91d484560a77479 Mon Sep 17 00:00:00 2001 From: Walker Date: Tue, 5 May 2026 10:41:21 -0500 Subject: [PATCH] Test cFS/workflows#136 --- .github/workflows/add-to-project.yml | 13 -- .../workflows/build-osal-documentation.yml | 74 ------- .github/workflows/codeql-cfe-build.yml | 7 +- .github/workflows/codeql-osal-default.yml | 7 +- .github/workflows/format-check.yml | 19 -- .github/workflows/icbundle.yml | 73 ------- .github/workflows/mcdc.yml | 204 ------------------ .github/workflows/standalone-build.yml | 129 ----------- .github/workflows/static-analysis.yml | 22 -- 9 files changed, 7 insertions(+), 541 deletions(-) delete mode 100644 .github/workflows/add-to-project.yml delete mode 100644 .github/workflows/build-osal-documentation.yml delete mode 100644 .github/workflows/format-check.yml delete mode 100644 .github/workflows/icbundle.yml delete mode 100644 .github/workflows/mcdc.yml delete mode 100644 .github/workflows/standalone-build.yml delete mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index 4142b77d4..000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Add Issue or PR to Project - -on: - issues: - types: [opened] - pull_request_target: - types: [opened, ready_for_review, converted_to_draft] - -jobs: - add-to-project: - name: Add issue or pull request to project - uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build-osal-documentation.yml b/.github/workflows/build-osal-documentation.yml deleted file mode 100644 index 03b8dc5ac..000000000 --- a/.github/workflows/build-osal-documentation.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: "Build OSAL Documentation (API Guide)" - -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -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"]' - - build-osal-apiguide: - #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 - container: ghcr.io/core-flight-system/cfsbuildenv-doxygen:latest - timeout-minutes: 15 - - steps: - - name: Checkout submodule - uses: actions/checkout@v4 - - - name: Set up for build - run: | - cp Makefile.sample Makefile - make prep - - - name: Build OSAL API Guide - run: | - make osal-apiguide 2>&1 > make_osal-apiguide_stdout.txt | tee make_osal-apiguide_stderr.txt - mv build/docs/osal-apiguide-warnings.log osal-apiguide-warnings.log - - - name: Archive Osal Guide Build Logs - uses: actions/upload-artifact@v4 - with: - name: OSAL Guide Artifacts - path: | - make_osal-apiguide_stdout.txt - make_osal-apiguide_stderr.txt - osal-apiguide-warnings.log - - - name: Error Check - run: | - if [[ -s make_osal-apiguide_stderr.txt ]]; then - cat make_osal-apiguide_stderr.txt - exit -1 - fi - - - name: Warning Check - run: | - if [[ -s osal-apiguide-warnings.log ]]; then - cat osal-apiguide-warnings.log - exit -1 - fi \ No newline at end of file diff --git a/.github/workflows/codeql-cfe-build.yml b/.github/workflows/codeql-cfe-build.yml index 718d6c6ce..291c34041 100644 --- a/.github/workflows/codeql-cfe-build.yml +++ b/.github/workflows/codeql-cfe-build.yml @@ -15,7 +15,8 @@ on: jobs: codeql: name: CodeQl Analysis - uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main + uses: arielswalker/cFS/.github/workflows/codeql-reusable.yml@test-cfs/workflows136 with: - component-path: osal - make: 'make -C build/native/default_cpu1/osal' + component-path: osal-bundle + prep: 'make native_std.prep' + make: 'make -C build-native_std/native/default_cpu1/osal' diff --git a/.github/workflows/codeql-osal-default.yml b/.github/workflows/codeql-osal-default.yml index b2455ee0e..24d8ff78a 100644 --- a/.github/workflows/codeql-osal-default.yml +++ b/.github/workflows/codeql-osal-default.yml @@ -15,9 +15,8 @@ on: jobs: codeql: name: CodeQl Analysis - uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main + uses: arielswalker/cFS/.github/workflows/codeql-reusable.yml@test-cfs/workflows136 with: - component-path: cFS # Causes reusable workflow to not checkout bundle + component-path: osal setup: 'cp Makefile.sample Makefile' - prep: 'make prep' - make: 'make' + make: 'make' \ No newline at end of file diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml deleted file mode 100644 index 243ad404d..000000000 --- a/.github/workflows/format-check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Format Check - -# Run on all push and pull requests -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - format-check: - name: Run format check - uses: nasa/cFS/.github/workflows/format-check.yml@dev \ No newline at end of file diff --git a/.github/workflows/icbundle.yml b/.github/workflows/icbundle.yml deleted file mode 100644 index 7fdaf09f8..000000000 --- a/.github/workflows/icbundle.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Integration Candidate Bundle Generation - -# Generate Integration Candidate branch for this repository. - -on: - workflow_dispatch: - inputs: - pr_nums: - description: 'The pull request numbers to include (Comma separated)' - required: true - type: string - -jobs: - generate-ic-bundle: - runs-on: ubuntu-latest - steps: - - name: Install Dependencies - run: | - sudo apt update - sudo apt install -y w3m - - name: Checkout IC Branch - uses: actions/checkout@v4 - with: - fetch-depth: '0' - ref: main - - name: Rebase IC Branch - run: | - git config user.name "GitHub Actions" - git config user.email "cfs-program@list.nasa.gov" - git pull - git checkout integration-candidate - git rebase main - - name: Merge each PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - prs=$(echo ${{ inputs.pr_nums }} | tr "," "\n") - for pr in $prs - do - src_branch=$(hub pr show -f %H $pr) - pr_title=$(hub pr show -f %t $pr) - commit_msg=$'Merge pull request #'"${pr}"$' from '"${src_branch}"$'\n\n'"${pr_title}" - git fetch origin pull/$pr/head:origin/pull/$pr/head - git merge origin/pull/$pr/head --no-ff -m "$commit_msg" - done - - name: Update Changelog and Version.h files - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - rev_num=$(git rev-list v6.0.0-rc4.. --count) - changelog_entry=$'# Changelog\\n\\n## Development Build: v6.0.0-rc4+dev'${rev_num} - prs=$(echo ${{ inputs.pr_nums }} | tr "," "\n") - see_entry=$'\-\ See:' - for pr in $prs - do - pr_title=$(hub pr show -f %t $pr) - changelog_entry="${changelog_entry}"$'\\n- '"${pr_title@Q}" - see_entry="${see_entry}"$' ' - done - changelog_entry="${changelog_entry}\n${see_entry}\n" - sed -ir "s|# Changelog|$changelog_entry|" CHANGELOG.md - - buildnumber_entry=$'#define OS_BUILD_NUMBER '${rev_num} - sed -ir "s|#define OS_BUILD_NUMBER.*|$buildnumber_entry|" src/os/inc/osapi-version.h - - name: Commit and Push Updates to IC Branch - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - rev_num=$(git rev-list v6.0.0-rc4.. --count) - git add CHANGELOG.md - git add src/os/inc/osapi-version.h - git commit -m "Updating documentation and version numbers for v6.0.0-rc4+dev${rev_num}" - git push -v origin integration-candidate diff --git a/.github/workflows/mcdc.yml b/.github/workflows/mcdc.yml deleted file mode 100644 index 1d300d1da..000000000 --- a/.github/workflows/mcdc.yml +++ /dev/null @@ -1,204 +0,0 @@ -name: MCDC Analysis - -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 - -env: - SIMULATION: native - TESTS_RAN: false - -jobs: - # Checks for duplicate actions. Skips push actions if there is a matching or - # duplicate pull-request action. - checks-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"]' - - mcdc: - needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') || contains(github.ref, 'main') }} - name: Build and Run MCDC - runs-on: ubuntu-22.04 - container: ghcr.io/core-flight-system/mcdc:latest - - steps: - - name: Checkout MCDC Script - uses: actions/checkout@v4 - with: - repository: nasa/cFS - path: mcdc - ref: dev - - - name: Checkout OSAL - uses: actions/checkout@v4 - with: - path: source - - - name: Modify osal to include coverage flags - run: | - sed -i 's/target_compile_options.*)/target_compile_options(ut_coverage_compile INTERFACE -pg -O0 -fprofile-arcs -ftest-coverage -fcondition-coverage -fprofile-abs-path)/' source/src/bsp/generic-linux/CMakeLists.txt - sed -i 's/set(UT_COVERAGE_COMPILE_FLAGS.*)/set(UT_COVERAGE_COMPILE_FLAGS -pg --coverage -O0 -fcondition-coverage -fprofile-abs-path)/' source/src/bsp/generic-linux/build_options.cmake - sed -i 's/set(UT_COVERAGE_LINK_FLAGS.*)/set(UT_COVERAGE_LINK_FLAGS -pg --coverage -O0 -fcondition-coverage -fprofile-abs-path)/' source/src/bsp/generic-linux/build_options.cmake - - - name: Set up build - run: cmake - -DCMAKE_BUILD_TYPE=Debug - -DENABLE_UNIT_TESTS=TRUE - -DOSAL_OMIT_DEPRECATED=FALSE - -DOSAL_VALIDATE_API=FALSE - -DOSAL_INSTALL_LIBRARIES=FALSE - -DOSAL_CONFIG_DEBUG_PERMISSIVE_MODE=TRUE - -DOSAL_SYSTEM_BSPTYPE=generic-linux - -DCMAKE_PREFIX_PATH=/usr/lib/cmake - -DCMAKE_INSTALL_PREFIX=/usr - -S source - -B build - - - name: Build OSAL - working-directory: build - run: make VERBOSE=1 - - - name: Execute Tests - working-directory: build - run: | - echo "BASE_DIR=build/unit-test-coverage" >> $GITHUB_ENV - (ctest --output-on-failure -j4 2>&1 || true) | tee ../test_results.txt - echo "TESTS_RAN=true" >> $GITHUB_ENV - - - name: Grab test modules - if: ${{ env.TESTS_RAN == 'true' }} - run: | - echo "MODULES=$(grep -oP 'Test\s+#\d+: \K[\w\-\_]+(?= )' test_results.txt | tr '\n' ' ' | sed 's/ $//')" >> $GITHUB_ENV - grep -oP 'Test #\d+: \K[\w\-\_]+' test_results.txt | tr '\n' ' ' | sed 's/ $//' >> modules.txt - - - name: Run mcdc analysis - if: ${{ env.TESTS_RAN == 'true' }} - run: bash mcdc/.github/scripts/mcdc-analyze.sh - - - name: Save PR number - if: github.event_name == 'pull_request' && always() - env: - PR_NUMBER: ${{ github.event.number }} - run: echo $PR_NUMBER > pr_number - - - name: Archive unit test results - # Upload if success or failure which supports skipping, unlike always() - if: ${{ env.TESTS_RAN == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Unit test results - path: | - test_results.txt - - - name: Archive mcdc results - # Upload if success or failure which supports skipping, unlike always() - if: ${{ env.TESTS_RAN == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: MCDC results - path: | - **/*.gcov.json.gz - mcdc_results.txt - pr_number - modules.txt - - summary-mcdc: - needs: mcdc - if: github.event_name == 'pull_request' && always() - name: Generate MCDC Comparison Summary - runs-on: ubuntu-22.04 - - steps: - - name: Checkout MCDC Script - uses: actions/checkout@v4 - with: - repository: nasa/cFS - path: mcdc - ref: dev - - - name: Download latest main branch artifact - continue-on-error: true - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - workflow: mcdc-internal.yml - search_artifacts: true - branch: dev - name: MCDC results - path: main-branch-results - - - uses: actions/download-artifact@v4 - with: - name: MCDC results - - - name: Compare main and PR artifacts - run: | - if [ -f "main-branch-results/mcdc_results.txt" ]; then - echo "Main branch artifact found. Running comparison." - bash mcdc/.github/scripts/mcdc-compare.sh main-branch-results/mcdc_results.txt mcdc_results.txt main-branch-results/modules.txt - else - echo "Main branch artifact not found. Skipping comparison step." - fi - - - name: Output summary to workflow - run: | - if [ -s "mcdc_comment.txt" ]; then - echo "### MC/DC Results (Comparison with dev branch)" >> $GITHUB_STEP_SUMMARY - echo '```plaintext' >> $GITHUB_STEP_SUMMARY - cat mcdc_comment.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - elif [ -s "mcdc_results.txt" ]; then - echo "### MC/DC Results (Current PR)" >> $GITHUB_STEP_SUMMARY - echo '```plaintext' >> $GITHUB_STEP_SUMMARY - cat mcdc_results.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - else - echo "No MCDC results found." >> $GITHUB_STEP_SUMMARY - fi - - # Output uncovered branches if the file exists and is not empty - if [ -s "uncovered.json" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "
" >> $GITHUB_STEP_SUMMARY - echo "Click to view uncovered branches (uncovered.json)" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo '```json' >> $GITHUB_STEP_SUMMARY - cat uncovered.json >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "
" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - fi - - - name: Archive mcdc comparison - # Upload if success or failure which supports skipping, unlike always() - if: success() || failure() - uses: actions/upload-artifact@v4 - with: - name: MCDC main branch comparison - path: | - mcdc_comment.txt - mcdc_compare.txt \ No newline at end of file diff --git a/.github/workflows/standalone-build.yml b/.github/workflows/standalone-build.yml deleted file mode 100644 index b68795ab5..000000000 --- a/.github/workflows/standalone-build.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Build and Test Standalone OSAL package - -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -defaults: - run: - shell: bash - -env: - allowed_ncov_lines: 0 - allowed_ncov_branches: 0 - allowed_ncov_functions: 0 - -jobs: - build-and-test: - name: Build and Execute Tests - runs-on: ubuntu-22.04 - container: - image: ghcr.io/core-flight-system/cfsbuildenv-linux:latest - options: --sysctl fs.mqueue.queues_max=512 --sysctl fs.mqueue.msg_max=512 - - strategy: - fail-fast: false - - steps: - - name: Checkout OSAL - uses: actions/checkout@v4 - with: - path: source - - - name: Set CXX environment variable - run: echo "CXX=/usr/bin/g++" >> $GITHUB_ENV - - - name: Set run_lcov=TRUE - run: echo "run_lcov=TRUE" >> $GITHUB_ENV - - - name: Set up debug environment - run: | - echo "DESTDIR=${{ github.workspace }}/staging-debug" >> $GITHUB_ENV - - - name: Set up build - run: cmake - -DCMAKE_BUILD_TYPE=Debug - -DENABLE_UNIT_TESTS=TRUE - -DOSAL_OMIT_DEPRECATED=FALSE - -DOSAL_VALIDATE_API=FALSE - -DOSAL_INSTALL_LIBRARIES=FALSE - -DOSAL_CONFIG_DEBUG_PERMISSIVE_MODE=TRUE - -DOSAL_SYSTEM_BSPTYPE=generic-linux - -DCMAKE_PREFIX_PATH=/usr/lib/cmake - -DCMAKE_INSTALL_PREFIX=/usr - -S source - -B build - - - name: Build OSAL - working-directory: build - run: make ${{ env.build_tgt }} -j2 - - - name: Execute Tests - working-directory: build - run: ctest --output-on-failure -j4 2>&1 | tee ../ctest.log - - - name: Check Coverage - id: stats - uses: ./source/.github/actions/check-coverage - with: - binary-dir: build - - - name: Enforce coverage function minimum - if: ${{ always() && steps.stats.outputs.ncov_functions > env.allowed_ncov_functions }} - run: | - echo "::error::Too many uncovered functions (${{ steps.stats.outputs.ncov_functions }})" - /bin/false - - - name: Enforce coverage line minimum - if: ${{ always() && steps.stats.outputs.ncov_lines > env.allowed_ncov_lines }} - run: | - echo "::error::Too many uncovered lines (${{ steps.stats.outputs.ncov_lines }})" - /bin/false - - - name: Enforce coverage branch minimum - if: ${{ always() && steps.stats.outputs.ncov_branches > env.allowed_ncov_branches }} - run: | - echo "::error::Too many uncovered branches (${{ steps.stats.outputs.ncov_branches }})" - /bin/false - - - name: Enforce keeping coverage function minimum up-to-date - if: ${{ always() && steps.stats.outputs.ncov_functions < env.allowed_ncov_functions }} - run: | - echo "::error::${{ steps.stats.outputs.ncov_functions }} uncovered function${{ steps.stats.outputs.ncov_functions == 1 && '' || 's' }} reported, but ${{ env.allowed_ncov_functions }} ${{ env.allowed_ncov_functions == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update the 'allowed_ncov_functions' variable to ${{ steps.stats.outputs.ncov_functions }} in order to match the new coverage level." - /bin/false - - - name: Enforce keeping coverage line minimum up-to-date - if: ${{ always() && steps.stats.outputs.ncov_lines < env.allowed_ncov_lines }} - run: | - echo "::error::${{ steps.stats.outputs.ncov_lines }} uncovered line${{ steps.stats.outputs.ncov_lines == 1 && '' || 's' }} reported, but ${{ env.allowed_ncov_lines }} ${{ env.allowed_ncov_lines == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update the 'allowed_ncov_lines' variable to ${{ steps.stats.outputs.ncov_lines }} in order to match the new coverage level." - /bin/false - - - name: Enforce keeping coverage branch minimum up-to-date - if: ${{ always() && steps.stats.outputs.ncov_branches < env.allowed_ncov_branches }} - run: | - echo "::error::${{ steps.stats.outputs.ncov_branches }} uncovered branch${{ steps.stats.outputs.ncov_branches == 1 && '' || 'es' }} reported, but ${{ env.allowed_ncov_branches }} ${{ env.allowed_ncov_branches == 1 && 'is' || 'are' }} allowed." - echo "::error::Please update the 'allowed_ncov_branches' variable to ${{ steps.stats.outputs.ncov_branches }} in order to match the new coverage level." - /bin/false - - - name: Assemble Results - if: ${{ always() }} - run: | - if [ -s ctest.log ]; then - echo '

CTest Execution

' >> $GITHUB_STEP_SUMMARY - echo '
' >> $GITHUB_STEP_SUMMARY
-            cat ctest.log >> $GITHUB_STEP_SUMMARY
-            echo '
' >> $GITHUB_STEP_SUMMARY - fi - if [ -s 'build/lcov-summary.xml' ]; then - cat 'build/lcov-summary.xml' >> $GITHUB_STEP_SUMMARY - fi \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 634bae3ad..000000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Static Analysis - -# Run on all push and pull requests -on: - push: - branches: - - dev - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - static-analysis: - name: Run Static Analysis - uses: nasa/cFS/.github/workflows/static-analysis.yml@main - with: - strict-dir-list: './src/bsp ./src/os' - cmake-project-options: -DENABLE_UNIT_TESTS=TRUE -DOSAL_OMIT_DEPRECATED=TRUE -DOSAL_SYSTEM_BSPTYPE=generic-linux