-
Notifications
You must be signed in to change notification settings - Fork 227
149 lines (127 loc) · 4.54 KB
/
Copy pathanalyzers.yaml
File metadata and controls
149 lines (127 loc) · 4.54 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Run analyzers
permissions: {}
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
cppcheck:
name: cppcheck on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cppcheck_install_command: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install cppcheck
- os: macos-latest
cppcheck_install_command: brew install cppcheck
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
${{ matrix.cppcheck_install_command }}
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=OFF \
-DBUILD_TESTING=OFF
- name: Run cppcheck
run: |
cppcheck \
--enable=style,portability,performance,warning \
--library=posix \
--library=cppcheck/segyio.cfg \
--suppressions-list=cppcheck/suppressions.txt \
--inline-suppr \
--project=build/compile_commands.json \
--error-exitcode=1 \
--check-level=exhaustive
scan_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install clang clang-tools libfindbin-libs-perl
- name: Configure segyio
run: |
scan-build --status-bugs \
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_PYTHON=OFF \
-DBUILD_TESTING=OFF
- name: Run scan-build
run: |
scan-build --status-bugs \
cmake \
--build build
valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install valgrind
- name: Build segyio
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="-g -O0" \
-DCMAKE_CXX_FLAGS_DEBUG="-g -O0" \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PYTHON=OFF
cmake --build build
- name: Run valgrind on C tests, file
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c.segy]"
- name: Run valgrind on C tests, mmap
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c.segy]" "--test-mmap"
- name: Run valgrind on C++ tests
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c++]"
valgrind-python-invalid-memory-access:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install valgrind
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install build/test dependencies
working-directory: python
run: |
python -m pip install -r requirements-dev.txt
- name: Configure
run: |
cmake -S . -B build \
-DBUILD_PYTHON=ON \
-DBUILD_TESTING=OFF \
-DBUILD_BIN=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="-g -O0" \
-DCMAKE_CXX_FLAGS_DEBUG="-g -O0" \
-DBUILD_SHARED_LIBS=ON \
- name: Build
run: |
cmake --build build
- name: Run valgrind memcheck on default pytests
run: |
cd python
# test_no_16bit_overflow_tracecount is too large for valgrind, so skip
# only "invalid memory access" checks. "Memory leaks" would be caused by python anyway.
valgrind --tool=memcheck --error-exitcode=1 pytest -rPV -k 'not test_no_16bit_overflow_tracecount'