@@ -35,32 +35,31 @@ jobs:
35
35
lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat \
36
36
python3 python3-pip python3-venv gcovr bc pipx wget \
37
37
software-properties-common
38
+ # Add the official LLVM repository and install Clang 19
38
39
wget https://apt.llvm.org/llvm.sh
39
40
chmod +x llvm.sh
40
41
./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
42
45
update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-19/bin/clang 100
43
46
update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-19/bin/clang++ 100
44
47
pipx install --system-site-packages mcdc-checker
45
48
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')"
59
59
- name : Build with Coverage Flags
60
60
run : |
61
61
export CFLAGS="-fprofile-arcs -ftest-coverage -g"
62
62
bash ${GITHUB_WORKSPACE}/support/scripts/build_internal.sh
63
-
64
63
- name : Generate Coverage Report and Badges
65
64
run : |
66
65
mkdir -p doc/coverage
74
73
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
75
74
curl -o doc/coverage/line-coverage-badge.svg "https://img.shields.io/badge/line%20coverage-${LINE_COVERAGE_PERCENT}%25-${LINE_COLOR}"
76
75
curl -o doc/coverage/branch-coverage-badge.svg "https://img.shields.io/badge/branch%20coverage-${BRANCH_COVERAGE_PERCENT}%25-${BRANCH_COLOR}"
77
-
78
76
- name : Commit Coverage Badges
79
77
run : |
80
78
git config user.name "github-actions"
83
81
git add doc/coverage/branch-coverage-badge.svg
84
82
git commit -m "Update coverage badges" || echo "No changes to commit"
85
83
git push origin HEAD
86
-
87
84
- name : Run MC/DC Analysis
88
85
run : |
89
86
echo "Setting up environment for MC/DC Checker..."
@@ -106,11 +103,15 @@ jobs:
106
103
$(find $GITHUB_WORKSPACE/src -type f -name '*.c' | tr '\n' ' ') \
107
104
$(find $GITHUB_WORKSPACE/test -type f -name '*.c' | tr '\n' ' ') \
108
105
> $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
113
109
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
+
114
115
- name : Archive Coverage Directory
115
116
uses : actions/upload-artifact@v3
116
117
with :
0 commit comments