-
Notifications
You must be signed in to change notification settings - Fork 124
238 lines (201 loc) · 6.44 KB
/
check.yml
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: check_code
on:
push:
# triggered on tag pushes with tags beginning with either "v" or "dev"
branch-ignore:
- '*'
tags:
- 'v*'
- 'dev*'
- 'ci*'
- 'check*'
pull_request:
# also triggered by pull requests on the "dev" & "mpi" branches
branches:
- 'dev'
- 'mpi'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PV_TAG: v5.13.0-headless
PV_REPO: topology-tool-kit/ttk-paraview
jobs:
# ----------------------- #
# Check source formatting #
# ----------------------- #
check-formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install latest clang-format
run: |
sudo apt update
sudo apt install -y clang-format
- name: Use clang-format to detect formatting issues
run: |
git ls-files | grep -E "\.cpp$|\.cxx$|\.h$|\.hpp$" | xargs clang-format -n -Werror
- name: Check line endings (Unix rather than DOS)
run: |
! git ls-files | xargs file "{}" ";" | grep CRLF
- name: Check files not ending with a newline [NOT ENFORCED]
run: |
for f in $(git ls-files | grep -Ev 'png$|ico$' ); do
test $(tail -c 1 $f | wc -l) -eq 0 && echo $f || true
done
- name: Check non-standard C++ file extensions [NOT ENFORCED]
run: |
git ls-files | grep -E "\.cxx$|\.cc$|\.hpp$|\.hxx$|\.txx$|\.tpp$|\.inl$" || true
- name: Check for files containing Unicode characters [NOT ENFORCED]
run: |
git ls-files | xargs file | grep Unicode || true
- name: Check for empty files
run: |
! git ls-files | xargs file | grep empty
- name: Check for VTK includes in the base layer
run: |
! git ls-files \
| grep "core/base" \
| grep -E "\.cpp$|\.cxx$|\.h$|\.hpp$" \
| xargs grep -e "^#include.*vtk"
- name: No "using namespace" directive in header files
run: |
! git ls-files \
| grep -E "\.h$|\.hpp$" \
| xargs grep "using namespace"
# ------------- #
# Code lint job #
# ------------- #
lint-code:
runs-on: ubuntu-22.04
strategy:
matrix:
config:
- {tidy: true, sa: false, dox: false}
- {tidy: false, sa: true, dox: false}
- {tidy: false, sa: false, dox: true}
env:
CMAKE_EXPORT_COMPILE_COMMANDS: ON
steps:
- uses: actions/checkout@v4
- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK dependencies
sudo apt install -y \
libboost-system-dev \
libeigen3-dev \
libgraphviz-dev \
libosmesa-dev \
libsqlite3-dev \
libwebsocketpp-dev \
graphviz \
python3-sklearn \
zlib1g-dev \
libqhull-dev \
doxygen \
clang-tidy
- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix
- name: Fetch TTK-ParaView headless Debian package
run: |
wget -O ttk-paraview-headless.deb \
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-ubuntu-22.04.deb
- name: Install ParaView .deb
run: |
sudo apt install ./ttk-paraview-headless.deb
- name: Create & configure TTK build directory
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
-DTTK_ENABLE_OPENMP=FALSE \
-DTTK_ENABLE_MPI=TRUE \
-DTTK_BUILD_DOCUMENTATION=TRUE \
$GITHUB_WORKSPACE
- name: Use clang-tidy to lint code
if: matrix.config.tidy
run: |
git ls-files \
| grep core \
| grep -E "\.cpp$|\.cxx$" \
| xargs -n1 -P$(nproc) clang-tidy -p build --warnings-as-errors="*" 2> /dev/null
- name: Use Clang static analyzer
if: matrix.config.sa
run: |
git ls-files \
| grep core \
| grep -E "\.cpp$|\.cxx$" \
| xargs -n1 -P$(nproc) clang-tidy -p build --checks="-*,clang-analyzer-*" --warnings-as-errors="*" 2> /dev/null
- name: Check Doxygen documentation warnings
if: matrix.config.dox
continue-on-error: true
run: |
cd build
! cmake --build . --target doc |& grep warning
# ----------------------- #
# Check compiler warnings #
# ----------------------- #
check-warnings:
runs-on: ubuntu-22.04
strategy:
matrix:
kamikaze: [KAMIKAZE=TRUE, KAMIKAZE=FALSE]
omp: [OPENMP=TRUE, OPENMP=FALSE]
simplexId: [64BIT_IDS=TRUE, 64BIT_IDS=FALSE]
opt: [Debug, Release]
mpi: [MPI=TRUE, MPI=FALSE]
env:
CMAKE_EXPORT_COMPILE_COMMANDS: ON
steps:
- uses: actions/checkout@v4
- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK dependencies
sudo apt install -y \
libboost-system-dev \
libeigen3-dev \
libgraphviz-dev \
libosmesa-dev \
libsqlite3-dev \
libwebsocketpp-dev \
graphviz \
python3-sklearn \
zlib1g-dev \
libqhull-dev \
clang-tools \
libomp-dev
- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix
- name: Fetch TTK-ParaView headless Debian package
run: |
wget -O ttk-paraview-headless.deb \
https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-ubuntu-22.04.deb
- name: Install ParaView .deb
run: |
sudo apt install ./ttk-paraview-headless.deb
- name: Create & configure TTK build directory
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.opt }} \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
-DTTK_ENABLE_${{ matrix.kamikaze }} \
-DTTK_ENABLE_${{ matrix.omp }} \
-DTTK_ENABLE_${{ matrix.mpi }} \
-DTTK_ENABLE_${{ matrix.simplexId }} \
$GITHUB_WORKSPACE
- name: Use clang-check for compiler warnings
run: |
git ls-files \
| grep core \
| grep -E "\.cpp$|\.cxx$" \
| xargs -n1 -P$(nproc) clang-check -p build --extra-arg=-Werror