-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (72 loc) · 2.06 KB
/
lint.yml
File metadata and controls
85 lines (72 loc) · 2.06 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
name: lint
on:
pull_request:
branches:
- "*"
jobs:
format-check:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update -qq
sudo apt-get install -qq clang-format
- name: Check code formatting
run: |
find . -type f \( -name "*.c" -o -name "*.h" \) \
! -path "./build*" \
! -path "./.git/*" \
| xargs clang-format --dry-run --Werror || {
echo "Code formatting check failed. Please run: clang-format -i <file>"
exit 1
}
static-analysis:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq \
clang \
clang-tidy \
clang-tools \
ninja-build \
libfftw3-dev \
libsndfile1-dev \
meson
- name: Configure build
run: |
meson setup build \
--buildtype=debug \
-Dwarning_level=3 \
-Denable_examples=true
- name: Run scan-build
run: |
scan-build --status-bugs \
meson compile -C build
- name: Run clang-tidy
run: |
# Use compile_commands.json from build directory
find src include -type f \( -name "*.c" -o -name "*.h" \) | \
xargs clang-tidy -p build --config-file=.clang-tidy
cppcheck:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cppcheck
run: |
sudo apt-get update -qq
sudo apt-get install -qq cppcheck
- name: Run cppcheck
run: |
cppcheck --enable=all --suppress=missingIncludeSystem \
--suppress=unusedFunction \
--error-exitcode=1 \
--inline-suppr \
--quiet \
src/ include/