Skip to content

Commit 12da1ce

Browse files
wgtmacraulcd
andauthored
Add GitHub cpp-linter-action (#20)
Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 9f99f85 commit 12da1ce

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/cpp-linter.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
18+
name: C++ Linter
19+
20+
on:
21+
pull_request:
22+
paths-ignore:
23+
- '.github/**'
24+
- 'ci/**'
25+
- 'cmake_modules/**'
26+
branches:
27+
- main
28+
29+
jobs:
30+
cpp-linter:
31+
runs-on: ubuntu-24.04
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Run build
35+
run: |
36+
mkdir build && cd build
37+
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
38+
cmake --build .
39+
- uses: cpp-linter/cpp-linter-action@v2.13.3
40+
id: linter
41+
continue-on-error: true
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
style: file
46+
tidy-checks: file
47+
files-changed-only: true
48+
lines-changed-only: true
49+
thread-comments: true
50+
ignore: 'build|cmake_modules|ci'
51+
database: build
52+
- name: Fail fast?!
53+
if: steps.linter.outputs.checks-failed != 0
54+
run: |
55+
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
56+
exit 1

.github/workflows/license_check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
name: "Run License Check"
19+
1920
on: pull_request
2021

2122
jobs:

0 commit comments

Comments
 (0)