-
Notifications
You must be signed in to change notification settings - Fork 108
45 lines (34 loc) · 1.31 KB
/
annotate_cpp.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
name: Annotate Cpp
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
annotate-cpp:
strategy:
matrix:
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: -1
- name: Install Ubuntu dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y clang-tidy
- name: Install dependencies from PyPI
run: |
python3 -m pip install "conan<2" pybind11 ecl
- name: Create compile commands for clib
run: |
mkdir cmake-build
cmake -S src/clib -B cmake-build -DBUILD_TESTS=ON -DCOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build cmake-build
- name: find changed files
id: find_changed_files
run: echo "changed_files=$(git diff --name-only ${{github.sha}} ${{github.event.pull_request.base.sha}} | tr ' ' '\n' | xargs ls -d 2>/dev/null | grep -E '\.(hpp|cpp)$' | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
- run: echo ::add-matcher::.github/clang-tidy-matcher.json
- name: run clang-tidy
run: clang-tidy -p cmake-build/ ${{steps.find_changed_files.outputs.changed_files}}
if: steps.find_changed_files.outputs.changed_files != ''