Skip to content

Commit 7f45fb4

Browse files
committed
ORC-1822: Use cpp-linter-action for clang-tidy and clang-format
1 parent d23b42d commit 7f45fb4

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

.github/workflows/build_and_test.yml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
name: Build and test
219

320
on:
@@ -158,22 +175,29 @@ jobs:
158175
./mvnw install -DskipTests
159176
./mvnw javadoc:javadoc
160177
161-
formatting-check:
162-
name: "C++ format check"
163-
runs-on: ubuntu-22.04
178+
cpp-linter:
179+
runs-on: ubuntu-24.04
164180
steps:
165-
- name: Checkout repository
166-
uses: actions/checkout@v4
167-
- name: Run build
181+
- uses: actions/checkout@v4
182+
- uses: cpp-linter/cpp-linter-action@v2.13.3
183+
id: linter
184+
continue-on-error: true
185+
env:
186+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187+
with:
188+
style: file
189+
tidy-checks: file
190+
files-changed-only: true
191+
lines-changed-only: true
192+
thread-comments: true
193+
ignore: 'build|cmake_modules|conan|dev|docker|examples|java|site'
194+
database: build/compile_commands.json
195+
extra-args: #-Wno-unused-parameter
196+
- name: Fail fast?!
197+
if: steps.linter.outputs.checks-failed != 0
168198
run: |
169-
mkdir build
170-
cd build
171-
cmake .. -DBUILD_JAVA=OFF -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DSTOP_BUILD_ON_WARNING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_CPP_ENABLE_METRICS=1
172-
make
173-
- name: Check clang-tidy
174-
run: cd build && make check-clang-tidy
175-
- name: Check clang-format
176-
run: cd build && make check-format
199+
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
200+
exit 1
177201
178202
license-check:
179203
name: "License Check"

0 commit comments

Comments
 (0)