Skip to content

Commit 5c56afa

Browse files
authored
[actions] enable clang-tidy in GitHub Actions (#1234)
1 parent a9110b7 commit 5c56afa

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/clang-tidy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Clang-tidy"
2+
3+
"on":
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
workflow_dispatch:
9+
10+
11+
env:
12+
LLVM_VERSION: "18"
13+
14+
jobs:
15+
scan:
16+
runs-on: ${{ github.repository_owner == 'intel' && 'ubuntu-latest' || 'service' }}
17+
container:
18+
image: "ubuntu:latest"
19+
20+
steps:
21+
- name: "Install dependencies"
22+
run: |
23+
apt-get update && apt-get install -y git cmake nasm lsb-release wget software-properties-common
24+
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && /bin/bash llvm.sh ${{ env.LLVM_VERSION }} all
25+
ln -s /usr/bin/clang-tidy-${{ env.LLVM_VERSION }} /usr/bin/clang-tidy
26+
27+
- name: "Checkout repository"
28+
uses: "actions/checkout@v4"
29+
with:
30+
submodules: "true"
31+
32+
- name: "Run clang-tidy scan"
33+
run: |
34+
mkdir build && cd build
35+
export CC=clang-${{ env.LLVM_VERSION }}
36+
export CXX=clang++-${{ env.LLVM_VERSION }}
37+
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DQPL_USE_CLANG_TIDY=ON
38+
cmake --build . --target install --parallel 8

0 commit comments

Comments
 (0)