-
Notifications
You must be signed in to change notification settings - Fork 21
108 lines (89 loc) · 2.94 KB
/
Copy pathanalysis.yml
File metadata and controls
108 lines (89 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Analysis
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson lcov gcovr libdbus-1-dev
- name: Configure with coverage
run: meson setup build -Db_coverage=true -Dlibdbus=enabled
- name: Build
run: meson compile -C build
- name: Run tests
run: meson test -C build
- name: Generate coverage report
run: |
gcovr --xml --output build/meson-logs/coverage.xml \
--root . \
--filter 'src/' \
--exclude 'tests/' \
--exclude 'examples/' \
build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: build/meson-logs/coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
static-analysis:
name: Static Analysis
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson clang clang-tools libdbus-1-dev
- name: Run Clang Static Analyzer
run: |
# Exclude meson-private to avoid false positives from meson's test files
scan-build --status-bugs --exclude build/meson-private \
meson setup build -Dlibdbus=enabled
scan-build --status-bugs --exclude build/meson-private \
-o scan-results meson compile -C build 2>&1 || {
echo "=== Static Analysis Errors Found ==="
echo ""
for report in scan-results/*/report-*.html; do
if [ -f "$report" ]; then
echo "--- $report ---"
# Extract bug info from HTML report
grep -E "BUGDESC|BUGTYPE|BUGFILE|BUGLINE" "$report" | \
sed 's/<!-- //g; s/ -->//g'
echo ""
fi
done
exit 1
}
clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson clang clang-tidy libdbus-1-dev
- name: Configure
run: meson setup build -Dlibdbus=enabled
env:
CC: clang
- name: Run clang-tidy
run: |
# Generate compile_commands.json is automatic with meson
# Run clang-analyzer checks (security and correctness)
find src -name '*.c' -exec clang-tidy --quiet {} \
-p build \
--checks='-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling' \
--warnings-as-errors='*' \;