Skip to content

Commit 0a63b2d

Browse files
authored
Merge pull request nasa#1526 from nasa/dev
Part nasa#686, Update cFS Bundle for v7.0.1
2 parents 24c8641 + f039bbc commit 0a63b2d

274 files changed

Lines changed: 3406 additions & 1634 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Add Issue or PR to Project
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened, ready_for_review, converted_to_draft]
8+
9+
jobs:
10+
add-to-project:
11+
name: Add issue or pull request to project
12+
uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev
13+
secrets: inherit

.github/workflows/build-osal-documentation.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ jobs:
3333
needs: check-for-duplicates
3434
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
3535
runs-on: ubuntu-22.04
36+
container: ghcr.io/core-flight-system/cfsbuildenv-doxygen:latest
3637
timeout-minutes: 15
3738

3839
steps:
39-
- name: Install Dependencies
40-
run: sudo apt-get update && sudo apt-get install doxygen graphviz -y
41-
4240
- name: Checkout submodule
43-
uses: actions/checkout@v4
41+
uses: actions/checkout@v6
4442

4543
- name: Set up for build
4644
run: |
@@ -53,7 +51,7 @@ jobs:
5351
mv build/docs/osal-apiguide-warnings.log osal-apiguide-warnings.log
5452
5553
- name: Archive Osal Guide Build Logs
56-
uses: actions/upload-artifact@v4
54+
uses: actions/upload-artifact@v7
5755
with:
5856
name: OSAL Guide Artifacts
5957
path: |
@@ -73,4 +71,4 @@ jobs:
7371
if [[ -s osal-apiguide-warnings.log ]]; then
7472
cat osal-apiguide-warnings.log
7573
exit -1
76-
fi
74+
fi

.github/workflows/codeql-cfe-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ on:
1515
jobs:
1616
codeql:
1717
name: CodeQl Analysis
18-
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
18+
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@dev
1919
with:
20-
component-path: osal
21-
make: 'make -C build/native/default_cpu1/osal'
20+
component-path: osal-bundle
21+
prep: 'make native_std.prep'
22+
make: 'make -C build-native_std/native/default_cpu1/osal'

.github/workflows/codeql-osal-default.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ on:
1515
jobs:
1616
codeql:
1717
name: CodeQl Analysis
18-
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
18+
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@dev
1919
with:
20-
component-path: cFS # Causes reusable workflow to not checkout bundle
20+
component-path: osal
2121
setup: 'cp Makefile.sample Makefile'
22-
prep: 'make prep'
2322
make: 'make'

.github/workflows/format-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ name: Format Check
22

33
# Run on all push and pull requests
44
on:
5+
push:
6+
branches:
7+
- dev
8+
- main
59
pull_request:
610
types:
711
- opened
812
- reopened
913
- synchronize
14+
workflow_dispatch:
1015

1116
jobs:
1217
format-check:
1318
name: Run format check
14-
uses: nasa/cFS/.github/workflows/format-check.yml@main
19+
uses: nasa/cFS/.github/workflows/format-check.yml@dev

.github/workflows/icbundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
sudo apt update
2020
sudo apt install -y w3m
2121
- name: Checkout IC Branch
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
with:
2424
fetch-depth: '0'
2525
ref: main

.github/workflows/mcdc.yml

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
name: MCDC Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
workflow_dispatch:
14+
15+
# Force bash to apply pipefail option so pipeline failures aren't masked
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
env:
21+
SIMULATION: native
22+
TESTS_RAN: false
23+
24+
jobs:
25+
# Checks for duplicate actions. Skips push actions if there is a matching or
26+
# duplicate pull-request action.
27+
checks-for-duplicates:
28+
runs-on: ubuntu-22.04
29+
# Map a step output to a job output
30+
outputs:
31+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
32+
steps:
33+
- id: skip_check
34+
uses: fkirc/skip-duplicate-actions@master
35+
with:
36+
concurrent_skipping: 'same_content'
37+
skip_after_successful_duplicate: 'true'
38+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
39+
40+
mcdc:
41+
needs: checks-for-duplicates
42+
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') || contains(github.ref, 'main') }}
43+
name: Build and Run MCDC
44+
runs-on: ubuntu-22.04
45+
container: ghcr.io/core-flight-system/mcdc:latest
46+
47+
steps:
48+
- name: Checkout MCDC Script
49+
uses: actions/checkout@v6
50+
with:
51+
repository: nasa/cFS
52+
path: mcdc
53+
ref: dev
54+
55+
- name: Checkout OSAL
56+
uses: actions/checkout@v6
57+
with:
58+
path: source
59+
60+
- name: Modify osal to include coverage flags
61+
run: |
62+
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
63+
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
64+
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
65+
66+
- name: Set up build
67+
run: cmake
68+
-DCMAKE_BUILD_TYPE=Debug
69+
-DENABLE_UNIT_TESTS=TRUE
70+
-DOSAL_OMIT_DEPRECATED=FALSE
71+
-DOSAL_VALIDATE_API=FALSE
72+
-DOSAL_INSTALL_LIBRARIES=FALSE
73+
-DOSAL_CONFIG_DEBUG_PERMISSIVE_MODE=TRUE
74+
-DOSAL_SYSTEM_BSPTYPE=generic-linux
75+
-DCMAKE_PREFIX_PATH=/usr/lib/cmake
76+
-DCMAKE_INSTALL_PREFIX=/usr
77+
-S source
78+
-B build
79+
80+
- name: Build OSAL
81+
working-directory: build
82+
run: make VERBOSE=1
83+
84+
- name: Execute Tests
85+
working-directory: build
86+
run: |
87+
echo "BASE_DIR=build/unit-test-coverage" >> $GITHUB_ENV
88+
(ctest --output-on-failure -j4 2>&1 || true) | tee ../test_results.txt
89+
echo "TESTS_RAN=true" >> $GITHUB_ENV
90+
91+
- name: Grab test modules
92+
if: ${{ env.TESTS_RAN == 'true' }}
93+
run: |
94+
echo "MODULES=$(grep -oP 'Test\s+#\d+: \K[\w\-\_]+(?= )' test_results.txt | tr '\n' ' ' | sed 's/ $//')" >> $GITHUB_ENV
95+
grep -oP 'Test #\d+: \K[\w\-\_]+' test_results.txt | tr '\n' ' ' | sed 's/ $//' >> modules.txt
96+
97+
- name: Run mcdc analysis
98+
if: ${{ env.TESTS_RAN == 'true' }}
99+
run: bash mcdc/.github/scripts/mcdc-analyze.sh
100+
101+
- name: Save PR number
102+
if: github.event_name == 'pull_request' && always()
103+
env:
104+
PR_NUMBER: ${{ github.event.number }}
105+
run: echo $PR_NUMBER > pr_number
106+
107+
- name: Archive unit test results
108+
# Upload if success or failure which supports skipping, unlike always()
109+
if: ${{ env.TESTS_RAN == 'true' }}
110+
uses: actions/upload-artifact@v7
111+
with:
112+
name: Unit test results
113+
path: |
114+
test_results.txt
115+
116+
- name: Archive mcdc results
117+
# Upload if success or failure which supports skipping, unlike always()
118+
if: ${{ env.TESTS_RAN == 'true' }}
119+
uses: actions/upload-artifact@v7
120+
with:
121+
name: MCDC results
122+
path: |
123+
**/*.gcov.json.gz
124+
mcdc_results.txt
125+
pr_number
126+
modules.txt
127+
128+
summary-mcdc:
129+
needs: mcdc
130+
if: github.event_name == 'pull_request' && always()
131+
name: Generate MCDC Comparison Summary
132+
runs-on: ubuntu-22.04
133+
134+
steps:
135+
- name: Checkout MCDC Script
136+
uses: actions/checkout@v6
137+
with:
138+
repository: nasa/cFS
139+
path: mcdc
140+
ref: dev
141+
142+
- name: Download latest main branch artifact
143+
continue-on-error: true
144+
uses: dawidd6/action-download-artifact@v2
145+
with:
146+
github_token: ${{ secrets.GITHUB_TOKEN }}
147+
workflow: mcdc-internal.yml
148+
search_artifacts: true
149+
branch: dev
150+
name: MCDC results
151+
path: main-branch-results
152+
153+
- uses: actions/download-artifact@v8
154+
with:
155+
name: MCDC results
156+
157+
- name: Compare main and PR artifacts
158+
run: |
159+
if [ -f "main-branch-results/mcdc_results.txt" ]; then
160+
echo "Main branch artifact found. Running comparison."
161+
bash mcdc/.github/scripts/mcdc-compare.sh main-branch-results/mcdc_results.txt mcdc_results.txt main-branch-results/modules.txt
162+
else
163+
echo "Main branch artifact not found. Skipping comparison step."
164+
fi
165+
166+
- name: Output summary to workflow
167+
run: |
168+
if [ -s "mcdc_comment.txt" ]; then
169+
echo "### MC/DC Results (Comparison with dev branch)" >> $GITHUB_STEP_SUMMARY
170+
echo '```plaintext' >> $GITHUB_STEP_SUMMARY
171+
cat mcdc_comment.txt >> $GITHUB_STEP_SUMMARY
172+
echo '```' >> $GITHUB_STEP_SUMMARY
173+
elif [ -s "mcdc_results.txt" ]; then
174+
echo "### MC/DC Results (Current PR)" >> $GITHUB_STEP_SUMMARY
175+
echo '```plaintext' >> $GITHUB_STEP_SUMMARY
176+
cat mcdc_results.txt >> $GITHUB_STEP_SUMMARY
177+
echo '```' >> $GITHUB_STEP_SUMMARY
178+
else
179+
echo "No MCDC results found." >> $GITHUB_STEP_SUMMARY
180+
fi
181+
182+
# Output uncovered branches if the file exists and is not empty
183+
if [ -s "uncovered.json" ]; then
184+
echo "" >> $GITHUB_STEP_SUMMARY
185+
echo "<details>" >> $GITHUB_STEP_SUMMARY
186+
echo "<summary>Click to view uncovered branches (uncovered.json)</summary>" >> $GITHUB_STEP_SUMMARY
187+
echo "" >> $GITHUB_STEP_SUMMARY
188+
echo '```json' >> $GITHUB_STEP_SUMMARY
189+
cat uncovered.json >> $GITHUB_STEP_SUMMARY
190+
echo '```' >> $GITHUB_STEP_SUMMARY
191+
echo "" >> $GITHUB_STEP_SUMMARY
192+
echo "</details>" >> $GITHUB_STEP_SUMMARY
193+
echo "" >> $GITHUB_STEP_SUMMARY
194+
fi
195+
196+
- name: Archive mcdc comparison
197+
# Upload if success or failure which supports skipping, unlike always()
198+
if: success() || failure()
199+
uses: actions/upload-artifact@v7
200+
with:
201+
name: MCDC main branch comparison
202+
path: |
203+
mcdc_comment.txt
204+
mcdc_compare.txt

0 commit comments

Comments
 (0)