-
Notifications
You must be signed in to change notification settings - Fork 227
107 lines (92 loc) · 3.27 KB
/
Copy pathanalyzers.yaml
File metadata and controls
107 lines (92 loc) · 3.27 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
name: Run analyzers
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="-O0" \
-DCMAKE_CXX_FLAGS_DEBUG="-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++]"