-
Notifications
You must be signed in to change notification settings - Fork 16
93 lines (81 loc) · 2.55 KB
/
clang-tidy-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
name: clang-tidy
on:
push:
branches: [ "main" ]
paths:
- "xpano/**"
- "tests/**"
- "misc/cmake/**"
- "CMakeLists.txt"
- ".clang-tidy"
pull_request:
branches: [ "main" ]
permissions:
contents: read # to fetch code (actions/checkout)
env:
BUILD_TYPE: Release
CATCH_VERSION: "v3.7.1"
EXIV2_VERSION: "v0.28.3"
jobs:
clang-tidy-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libopencv-dev libsdl2-dev libspdlog-dev
- name: Cache Catch
uses: actions/cache@v4
id: cache-catch
with:
path: catch/install
key: ${{runner.os}}-catch-${{env.CATCH_VERSION}}-${{env.BUILD_TYPE}}-22.04
- name: Install Catch
if: steps.cache-catch.outputs.cache-hit != 'true'
run: |
git clone https://github.com/catchorg/Catch2.git catch --depth 1 --branch $CATCH_VERSION
cd catch
cmake -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=OFF
cmake --build build -j $(nproc) --target install
cd ..
- name: Cache exiv2
uses: actions/cache@v4
id: cache-exiv2
with:
path: exiv2/install
key: ${{runner.os}}-exiv2-${{env.EXIV2_VERSION}}-${{env.BUILD_TYPE}}-22.04
- name: Install exiv2
if: steps.cache-exiv2.outputs.cache-hit != 'true'
run: |
git clone https://github.com/Exiv2/exiv2.git --depth 1 --branch $EXIV2_VERSION
cd exiv2
cmake -B build \
-DCMAKE_INSTALL_PREFIX=install \
`cat ../misc/build/exiv2-minimal-flags.txt`
cmake --build build --target install -j $(nproc)
cd ..
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_TESTING=ON \
-DCatch2_ROOT=`pwd`/catch/install \
-Dexiv2_ROOT=`pwd`/exiv2/install
- name: Run clang-tidy
run: |
run-clang-tidy-18 `pwd`/xpano `pwd`/tests \
-p=build \
-quiet \
-header-filter=xpano/xpano.*xpano \
-export-fixes=fixes.yml
- name: Check clang-tidy results
run: |
python -m venv venv
source venv/bin/activate
python -m pip install -r misc/scripts/python/requirements.txt
python misc/scripts/python/check_fixes.py fixes.yml