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
|
name: clang-tidy-review
on: [pull_request]
jobs:
compile:
name: ${{matrix.buildname}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
buildname: 'clang-tidy'
triplet: x64-linux
compiler: clang_64
qt: '5.15.2'
steps:
- uses: actions/checkout@master
- name: Restore Qt cache
uses: actions/cache@master
id: cache-qt
with:
path: ${{github.workspace}}/Qt/${{matrix.qt}}
key: ${{matrix.os}}-qt-${{matrix.qt}}-cache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{matrix.qt}}
dir: ${{github.workspace}}
cached: ${{steps.cache-qt.outputs.cache-hit}}
aqtversion: '==1.1.2'
- name: Install Catch2
shell: bash
run: |
curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz
tar xvf catch2.tar.gz
cd Catch2-2.13.4
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
- name: Use CMake 3.20.1
uses: lukka/get-cmake@main
- name: Generate compile_commands.json
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{github.workspace}}/CMakeLists.txt'
buildDirectory: '${{github.workspace}}/build'
cmakeAppendedArgs: >-
-DCMAKE_GLOBAL_AUTOGEN_TARGET=ON
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DENABLE_CLAZY:BOOL=ON
buildWithCMakeArgs: >-
--target autogen
- uses: ZedThree/clang-tidy-review@v0.8.3
id: review
with:
build_dir: 'build'
clang_tidy_checks: '-*,performance-*,readability-*,bugprone-*,clang-analyzer-*,cppcoreguidelines-*,mpi-*,misc-*,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-init-variables,-cppcoreguidelines-pro-type-member-init,-*-magic-numbers'
apt_packages: 'pkg-config,libzip-dev,libglu1-mesa-dev,libpulse-dev'
max_comments: 10
# If there are any comments, fail the check
- if: steps.review.outputs.total_comments > 0
run: exit 1
|