Skip to content

Commit 19920f2

Browse files
authored
[#258] MCDC Cleanup
1 parent c3d3b59 commit 19920f2

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

.github/workflows/mc_dc_coverage.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,31 @@ jobs:
3535
lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat \
3636
python3 python3-pip python3-venv gcovr bc pipx wget \
3737
software-properties-common
38+
# Add the official LLVM repository and install Clang 19
3839
wget https://apt.llvm.org/llvm.sh
3940
chmod +x llvm.sh
4041
./llvm.sh 19
41-
apt-get install -y clang-19 libclang-19-dev python3-clang
42+
apt-get install -y clang-19 libclang-19-dev python3-clang-19
43+
apt-get remove -y libclang-14-dev libclang-common-14-dev libclang1-14 libllvm14 python3-clang-14
44+
# Ensure Clang 19 is the default
4245
update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-19/bin/clang 100
4346
update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-19/bin/clang++ 100
4447
pipx install --system-site-packages mcdc-checker
4548
pipx ensurepath
46-
47-
# - name: Verify Clang Installation
48-
# run: |
49-
# echo "Checking clang binary..."
50-
# which clang || { echo "clang not found in PATH"; exit 1; }
51-
# echo "clang version:"
52-
# clang --version
53-
54-
# - name: Verify Clang Python Bindings
55-
# run: |
56-
# echo "Testing Clang Python bindings..."
57-
# python3 -c "import clang.cindex; print('Clang bindings are working')"
58-
49+
- name: Verify Clang Installation
50+
run: |
51+
echo "Checking clang binary..."
52+
which clang || { echo "clang not found in PATH"; exit 1; }
53+
echo "clang version:"
54+
clang --version
55+
- name: Verify Clang Python Bindings
56+
run: |
57+
echo "Testing Clang Python bindings..."
58+
python3 -c "import clang.cindex; print('Clang bindings are working')"
5959
- name: Build with Coverage Flags
6060
run: |
6161
export CFLAGS="-fprofile-arcs -ftest-coverage -g"
6262
bash ${GITHUB_WORKSPACE}/support/scripts/build_internal.sh
63-
6463
- name: Generate Coverage Report and Badges
6564
run: |
6665
mkdir -p doc/coverage
@@ -74,7 +73,6 @@ jobs:
7473
if [ "$BRANCH_COVERAGE_PERCENT" -ge 80 ]; then BRANCH_COLOR="brightgreen"; elif [ "$BRANCH_COVERAGE_PERCENT" -ge 50 ]; then BRANCH_COLOR="yellow"; else BRANCH_COLOR="red"; fi
7574
curl -o doc/coverage/line-coverage-badge.svg "https://img.shields.io/badge/line%20coverage-${LINE_COVERAGE_PERCENT}%25-${LINE_COLOR}"
7675
curl -o doc/coverage/branch-coverage-badge.svg "https://img.shields.io/badge/branch%20coverage-${BRANCH_COVERAGE_PERCENT}%25-${BRANCH_COLOR}"
77-
7876
- name: Commit Coverage Badges
7977
run: |
8078
git config user.name "github-actions"
@@ -83,7 +81,6 @@ jobs:
8381
git add doc/coverage/branch-coverage-badge.svg
8482
git commit -m "Update coverage badges" || echo "No changes to commit"
8583
git push origin HEAD
86-
8784
- name: Run MC/DC Analysis
8885
run: |
8986
echo "Setting up environment for MC/DC Checker..."
@@ -106,11 +103,15 @@ jobs:
106103
$(find $GITHUB_WORKSPACE/src -type f -name '*.c' | tr '\n' ' ') \
107104
$(find $GITHUB_WORKSPACE/test -type f -name '*.c' | tr '\n' ' ') \
108105
> $GITHUB_WORKSPACE/doc/coverage/mcdc_checker_output.log 2>&1 || true
109-
# - name: Display MC/DC Checker Output
110-
# run: |
111-
# echo "Displaying MC/DC Checker Output:"
112-
# cat $GITHUB_WORKSPACE/doc/coverage/mcdc_checker_output.log
106+
107+
echo "Displaying MC/DC Checker Output:"
108+
cat $GITHUB_WORKSPACE/doc/coverage/mcdc_checker_output.log
113109

110+
- name: Display MC/DC Checker Output
111+
run: |
112+
echo "Displaying MC/DC Checker Output:"
113+
cat $GITHUB_WORKSPACE/doc/coverage/mcdc_checker_output.log
114+
114115
- name: Archive Coverage Directory
115116
uses: actions/upload-artifact@v3
116117
with:

0 commit comments

Comments
 (0)