Skip to content

Commit bff80e4

Browse files
authored
add clang-tidy github actions (#67)
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
1 parent 7de532c commit bff80e4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/clang-tidy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: clang-tidy
2+
3+
on: [push]
4+
5+
env:
6+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+
BUILD_TYPE: Release
8+
9+
jobs:
10+
clang-tidy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: install-clang-tidy
17+
run: sudo apt-get install -y clang-tidy
18+
19+
- name: install-boost
20+
run: sudo apt-get install -y libboost-all-dev
21+
22+
- name: fetch-gtest
23+
run: sudo apt-get install -y libgtest-dev
24+
25+
- name: install-gtest
26+
run: cd /usr/src/gtest && sudo cmake . && sudo make && sudo cp lib/*.a /usr/lib
27+
28+
- name: Create Build Environment
29+
# Some projects don't allow in-source building, so create a separate build directory
30+
# We'll use this as our working directory for all subsequent commands
31+
run: cmake -E make_directory ${{github.workspace}}/build
32+
33+
- name: Configure CMake
34+
# Use a bash shell so we can use the same syntax for environment variable
35+
# access regardless of the host operating system
36+
shell: bash
37+
working-directory: ${{github.workspace}}/build
38+
# Note the current convention is to use the -S and -B options here to specify source
39+
# and build directories, but this is only available with CMake 3.13 and higher.
40+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
41+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
42+
43+
- name: run-clang-tidy
44+
run: clang-tidy -p ${{github.workspace}}/build -header-filter=.* -checks=-*,clang-analyzer-*,concurrency-*,cert-*,-cert-err58-cpp,google-explicit-constructor,misc-redundant-expression,readability-braces-around-statements.ShortStatementLines=1,readability-delete-null-pointer,readability-make-member-function-const,cppcoreguidelines-special-member-functions example/s3select_example.cpp
45+

0 commit comments

Comments
 (0)